views:

160

answers:

2

I have a created a report for payments and I need to be able to put totals at the bottom of each page such as the total number of payments, total balance etc. The rdlc designer will not allow me to reference Fields in the page footer? Thanks for the help

A: 

Edit expression

Enter something like this.

=Sum(Fields.BLAH.Value)

Thanks,

Eric-

Eric Brown - Cal
How could I get this to show up on every single page of the report with totals just for that page only?
J Cooper
if you are using a grid, add the sum in the footer row, select the whole table (as if you were going to change the column width/height) right click on the square in the upper right corner of the grid, select properties. On that properties window check "repeat footer on each page".If that does not work, set up a group and do the same thing, but on the group properties. I remember having to fiddle a little to get per page summaryies as opposed to the full report summary, can't remember for sure if it has to be a group or not. All my reports are grouped anyway.
Eric Brown - Cal
hmmm the repeat footer on each page, I remember seeing this. I'm gonna give it a shot and post my results. thanks
J Cooper
+5  A: 

Updated Answer

To do what you're asking, you need to access the ReportItems collection.

From TechNet:

  • The ReportItems collection is the collection of text boxes on each page after report rendering occurs.

The following will allow you to put the total for a "Payment" column in the footer of each page. The total will be only the total of the column on that particular page and not the total for the entire report:

=SUM(ReportItems!Payment.Value)

Old Answer

You need to set the scope of the SUM aggregate function to be based on the dataset from which the report is created.

The following will work for you (just change the desired field to sum and the name of your dataset:

=Sum(Fields!ID.Value, "DataSet1")

You can even take things a step further if you want to filter the dataset. The following code will limit the sum to IDs over 4 (modify the example and take it as you need):

=Sum(IIF(Fields!ID.Value < 4,0,Fields!ID.Value), "DataSet1")
Alison
I am using the same dataset for the whole report. When it renders, it is lets say 10 pages long. I'm looking to get the total for each page printed on the footer of each page. So page 1 will only have totals for data on page 1 only.
J Cooper
Page 2 will only have totals for page 2 data. I could be thinking of this wrong but I don't this will work unless I was using a different datasets on each page. thanks for trying
J Cooper
Ah, I see. I thought you were looking for the entire report total to be printed on each page. Of course, now that I read your initial comment more clearly that is now pretty obvious. This should still be doable and I think we can figure it out.
Alison