Print Page | Close Window

New Page Before- WhilePrintingRecords - Timing

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4418
Printed Date: 29 Apr 2024 at 6:13am


Topic: New Page Before- WhilePrintingRecords - Timing
Posted By: ders
Subject: New Page Before- WhilePrintingRecords - Timing
Date Posted: 01 Oct 2008 at 8:09am
I'm having timing issues with a CRXI report.

I have a formula field called @Count in Details (and it's initialized to zero in the header) that looks like this (I'm simplifying):

WhilePrintingRecords;
NumberVar counter;
counter:=counter+1

I want a new page after 38 records, and I have different Page Footers depending on if that new page was due to the 38 record limit or due to no more records available in the group.

So, for New Page After (or before) on details, I have:
{@Count } >= 38


And, in the suppress footer code I have:

(
not nextisnull({someDBfield}) and {grpDBField} <> NEXT({grpDBField})
and {@Count }<38
)
or
TotalPageCount=PageNumber

So, since I use WhilePrintingRecords for the field, when is this @Count field being evaluated?  If I use "New Page Before", is the field evaluated, then a new page, then reevaluate for the same record after the new page?  What is the "NEXT" in the page footer referring to in this case... the record that caused the new page or the record after this?

Pointing me to some documentation (besides what's included with CR) would be great.. I'm just having a hard time figuring out what SHOULD happen.





Print Page | Close Window