Sunday, February 12, 2012

Calculating grand total in header

I have a report that has a Page Total and a Grand Total in the header.
The Page Total is being calculated from a field in the report like so:
=sum(ReportItems!tcBodyAmount.Value)
where tcBodyAmount is the name I gave the textbox in the report body
that calculates a value.
However, now I need a Grand Total and I can't get the syntax correct.
I've tried summing the PageTotal and I get a different error each time.
I can't use a field in the header. I tried doing a sum on the Page
Total sum but get the error that aggregate functions can't be nested.
I've also tried moving the totals into the body of the report and I get
the error that aggregate functions can only be used in the header and
footer.
The help feature was never loaded so I don't have access to that. Can
anyone give me some guidance on this? Thank you!try a sub report that calcs the total and thats in your header|||I tried that and got a message saying that a subreport can't be placed
in the header or footer|||Try placing in the header
= sum(Fields!Fieldname.Value,"datasetname")
see if that works
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"Carol" wrote:
> I have a report that has a Page Total and a Grand Total in the header.
> The Page Total is being calculated from a field in the report like so:
> =sum(ReportItems!tcBodyAmount.Value)
> where tcBodyAmount is the name I gave the textbox in the report body
> that calculates a value.
> However, now I need a Grand Total and I can't get the syntax correct.
> I've tried summing the PageTotal and I get a different error each time.
> I can't use a field in the header. I tried doing a sum on the Page
> Total sum but get the error that aggregate functions can't be nested.
> I've also tried moving the totals into the body of the report and I get
> the error that aggregate functions can only be used in the header and
> footer.
> The help feature was never loaded so I don't have access to that. Can
> anyone give me some guidance on this? Thank you!
>|||I had tried exactly that and I get the error message that fields cannot
be called in the header. I even did a search on that one and found an
old posting that said that cannot be done.
I tried the Grand Total as =sum(ReportItems!PageTotal.Value), thinking
that should sum all of the page totals. I didn't get an error, but
instead got no output for both the Grand Total and the Page Total when
I did that. Weird because when I clear that sum, the Page Total prints
fine.

No comments:

Post a Comment