Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Reports Adding Two Column Values

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!!!!

like image 600
Luis Avatar asked Dec 17 '22 18:12

Luis


1 Answers

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

alt textalt text

A list of available ReportItems will pop up when you hit '!' after ReportItems.

like image 133
D.S. Avatar answered Jan 28 '23 15:01

D.S.