Is it possible to add two column values say I have 3 columns:
Item 1 | Item 2 | Total
=Fields!Item1.Value | =Fields!Item1.Value | ???
What I want to avoid (for maintainability reasons) is doing something like this:
=Fields!Item1.Value + Fields!Item2.Value
I am rather looking for something like
Column1Value + Column2Value
Thanks Guys!!!!
Sounds like what you would like to do is reference the value of the report object (the textbox) rather than the column from the query. You can do this by using ReportItems!.
When you drag out the column from the dataset, it may name the text box after the column, if the column name can vary you will want to assign a static value to the text box in which the value will appear.
So, in the initial example you gave, you will have textboxes by the names of Item1, Item2, and Total. Thus, in the appropriate Total textbox you will want:
=ReportItems!Item1.Value + ReportItems!Item2.Value
or if you named the textboxes Red and Blue it would be:
=ReportItems!Red.Value + ReportItems!Blue.Value
A list of available ReportItems will pop up when you hit '!' after ReportItems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With