Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Forms RDLC Page Totals In Page Footer 1

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
0
36
US
I'm trying to put page totals on a Windows Form 2008 RDLC report using
Code:
=SUM(Fields!buyprice.Value)
for the textbox, but I get the following error.
"The Value expression for the textbox ‘textbox17’ refers to a field. Fields cannot be used in page headers or footers."
Is there anyway around this? I want the totals for each page, not a running total.

On another note, why did they make these reports so that you can't use the fields in the page header or footer without resorting to using Report Items? Am I going to have to use some sort of code to sum these?

Auguy
Sylvania/Toledo Ohio
 
Just change the textbox expression to this:

=SUM([red]ReportItems[/red]!buyprice.Value)

I confirmed that this does produce per-page totals, not running totals.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Yes that does work, thanks. I was going down that path when I saw your post. The only problem I have is that I used
Code:
=IIF(Fields!buyprice.Value = 0, "-", Fields!buyprice.Value)
for some of the fields to print a Dash instead of zero. I made a separate detail row to hold just the field names, but you cannot hide the row because then the report items don't work and you can only set the row height to a minimum of 0.03125in and make the individual cells hidden. That's not bad but does add space between the visible detail rows. Is there a way to format zero values as a Dash? I also cannot figure out how to get a record count per page.

Late Update: I figured out how to do the Dashes. I can set the Format to
Code:
=IIF(Fields!buyprice.Value = 0, "-", "n2")
and it works. Still working on Record Count per page.

Auguy
Sylvania/Toledo Ohio
 
To get record count per page, do the same as with the totals. Add a textbox in the page footer and add this for the expression:

=Count(ReportItem!buyprice.Value)

I have confirmed that this gives the count of rows on each page of the report.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Thought I tried that, must of done something wrong. I was getting the correct count on some pages but count + 1 on others. I will try again. Thanks

Auguy
Sylvania/Toledo Ohio
 
Tried the row count again, works now. Thanks

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top