which actually returns the right value. And now When I added a total row from the Row Group pane through the Detail level as there are no group involve in the report , no total was added. I have tried using ReportItems, RunningValue but unable
to add a total to the report without the error "...aggregate function can only be used on report items contained in a page header and footer." My expression was:
How do I add up the column containing the first expression above?
Just as you said, Aggregate functions (including sum function) can only be used on report items contained in page headers and footers in Reporting Services. So we can’t sum on report items on report body. While, we can use Custom Code to write a function
to achieve the same goal. So in order to meet you requirement, you can try to use the custom code below to sum the calculated column values:
Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
Public Shared Value as double=0
Public Shared Function GetValue(Item as double) as double
value= value + Item
Public Shared Function GetTotal()
Replace the original expression
Use the following expression to get the sum value:
If you have any more questions, please feel free to ask.