Solved

How do I add a Row Count in the Page Footer Section that counts the number of rows on the current page?

Posted on 2014-12-02
9
469 Views
Last Modified: 2014-12-06
How do I add a Row Count in the Page Footer Section that counts the number of rows on the current page?  I can create a total report count in the Report Footer, but what I need is to have it summarized per page.  I am using Crystal XI (and also 2008) stand alone.
0
Comment
Question by:eeyo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 23

Accepted Solution

by:
Ido Millet earned 250 total points
ID: 40477634
Use a variable. Reset it to 0 in a Page Header formula. Increment it in a detail section or group section formula, and display it in a page footer formula.
0
 

Author Comment

by:eeyo
ID: 40478849
Use a variable. Reset it to 0 in a Page Header formula. Increment it in a detail section or group section formula, and display it in a page footer formula.
Newbie question:  I have created formulas, but where do I put the formula in the page header?  Do I use Section Expert and click one of the X-2 buttons?
0
 
LVL 23

Expert Comment

by:Ido Millet
ID: 40478884
You simply place the formula in the Group Header.  Anywhere in that section.  You can suppress the formula, so it's not visible.
0
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 

Author Comment

by:eeyo
ID: 40482205
I am one step closer but the math doesn't seem to work.  I get 0 for the header, 1 for each of the rows in the detail section (instead of incrementing), and I get a page footer total of 1 (instead of actual number of rows on the page).  Any thoughts?

Formula for the Page Header
Global RowCount as Number
RowCount = 0
formula = RowCount

Open in new window


Formula for the details
Global RowCount as number
RowCount = Rowcount + 1
formula = RowCount

Open in new window


Formula for the Page Footer
Global RowCount as number
formula = RowCount

Open in new window

0
 
LVL 23

Expert Comment

by:Ido Millet
ID: 40482219
The assignment operator is ':='
You are using '=' instead.
0
 

Author Comment

by:eeyo
ID: 40482242
Sorry, I forget to specify that I am using Basic Syntax instead of Crystal Syntax.  I guess I could try with Crystal Syntax, but I think it is something else.  All three formulas verify OK when I using the formula verification button.
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 250 total points
ID: 40482566
Try adding WhilePrintingRecords as the first line in each formula.  Since you're not referencing any db fields in the detail formula, CR defaults to evaluating it once, before the records are read (even if you put the formula in the detail section).  Adding WhilePrintingRecords to the detail formula (and putting the formula in the detail section) forces CR to (re)evaluate the formula when it "prints" each record.

 And if you add WhilePrintingRecords to the detail formula, you need to add it to the others too, so that all of the formulas are evaluated during the same pass through the report.  Otherwise, your count isn't reset in the page header, or you don't get the total in the page footer, because those formulas are evaluated before the "printing" pass.

 FWIW, what got me on to this was a note in the CR Help about using WhileReadingRecords (as opposed to WhilePrintingRecords) to force a formula to be evaluated as the records are read, but WhileReadingRecords didn't work for me (the count still wasn't incremented).  I don't know why.  So I tried WhilePrintingRecords instead and that seemed to work fine.  <shrug>

 James
0
 
LVL 23

Expert Comment

by:Ido Millet
ID: 40482717
Yes, as James suggested, use WhilePrintingRecords.
0
 

Author Comment

by:eeyo
ID: 40484726
Using a mulit-section global variable and WhilePrintingRecords solved this problem.  Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question