In SSRS Reports, you can easily make use of running totals on every page of your report. SQL Server Reporting Service does not have a standard functionality for this. Here I will explain how you can implement running totals in your report.
- Add a tablix to your report and add a dataset to it. In my example I have 3 columns:
Debtor code, Account Name and Outstanding amount. - Add a 4th column to the tablix. Set the visibility of this column to Hide.
- Select in the 4th column the detail row. Select Text Box Properties and change the name of the textbox to ‘RunningTotal’.
- Select Value and press the expression button. In this expression we will define the running total of the column. In my example, I have a columns Outstanding from the dataset ‘CreditLimitDetails’
=RunningValue(Fields!Outstanding.Value,SUM,”CreditLimitDetails”)
Now we have a running value of the outstanding amount in the 4th column. - To display the running value on every page, we will use the page footer.
- Add a page footer to your report. In BIDS you can select, Report, Add Page footer.
- In this example I will add a page total and a running total to the report.
- Insert a 2 text boxes to the page footer.
- Open the expression definition of the first text box. In this text box we will define the totaal outstanding amount of the current page.
=”Page Total: ” + cstr(Sum(ReportItems!Outstanding.Value)) - Open the expression definition of the second text box. In this text box we will define the Running total of the outstanding column of the current page and all previous pages.
=”Running Total: ” +cstr(Last(ReportItems!RunningTotal.Value))
Now your report will print running totals at the bottom of every page.