April 7, 2009 at 6:03 am
Hi,
I have 2 textboxes on my report (for example textbox1 and textbox2.)
Both textboxes are using IIF statements to return a sum of values and the number is displayed as the result in these 2 textboxes.
Now I have a 3rd textbox called textbox3.
I want to do a sum of textbox1 + textbox2 and display the result in textbox 3.
So textbox 3's expression will look something like this:-
Sum((textbox1.Value)+(textbox2.Value))
How can I do this?
April 7, 2009 at 9:33 am
You need to use the ReportItems collection like this:
=ReportItems.textbox1.Value + ReportItems.textbox2.Value
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 7, 2009 at 9:41 am
I am getting an error with that:-
The value expression for the textbox3 contains an error[BC30456] "textbox1" is not a member of Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItems
April 7, 2009 at 9:47 am
Then your textbox is not named textbox1. Check to see what it is named.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 7, 2009 at 9:54 am
I have re-named them but it's coming up with the exact same error message. Just with the names changed.
My first textbox is now called 'self1'. The second one is called 'self2'.
the third one displaying the result is called 'result'.
I noticed after my textbox name in my expression 'value' was not an option in the drop down list brought up by intellisense.
This is my expression:-
=ReportItems.self1.Value + ReportItems.self2.Value
There is a red line under the first ReportItems saying wrong number of arguments
April 7, 2009 at 10:02 am
Sorry, my bad. It's not:
=ReportItems.textbox1.Value + ReportItems.textbox2.Value
it is:
=ReportItems!textbox1.Value + ReportItems!textbox2.Value
Replace the period after ReportItems with an "!". I always do that:w00t:
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 7, 2009 at 10:04 am
That worked, thanks for all your help with this.
April 3, 2017 at 1:35 am
Thank you gentlemen for the question and answer, but damn you Google!
I, along with who knows who else, grabbed the first (and wrong) answer only to be flabbergasted just like OP, and had to come back and read the rest of the thread.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply