In footer I have 2 textboxes named curTotal and sub_total.
In header I have third textbox named result.
What I want to do is to subtract values of footer: result = sub_total - curTotal;
curTotal expression is (=sum(reportitems!lineamount1.value)
)
and
sub_total expression is (=Last(ReportItems!runningTotal.Value)
)
"runningTotal" is a field in tablix which has expression (=RunningValue(Fields!LineAmount.Value, SUM, "SalesInvoiceDS")
)
I have tried to add to result expression following (=reportitems!sub_total.value - reportitems!curTotal.value
) but it gives error that textbox refers to several report elements.
Please guide me how to correctly perform Math functions like subtract, multiple, division etc... with textBoxes in footer / header.
Unfortunately you cannot perform operations that combine ReportItems. Therefore the mathematics needs to take place at the appropriate row level using values derived from the data source and the results held in hidden fields at this level that can then be referred to using ReportItems.
So one approach would be to add a dummy outer grouping level to your report with a footer that you use to calculate these values. This footer line can be hidden and used as a source of ReportItems for your footer and possibly your header.
Also see http://www.keepitsimpleandfast.com/2011/09/running-totals-per-page-in-ssrs-to.html