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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

page break........

Status
Not open for further replies.

ITeC

Technical User
Apr 9, 2002
20
0
0
GB
Hi,
I want a page break in the detail secion if detail section exceeds 40 lines .conditaionally is this possible..please let me know
regards
 
Sure. Create an expression in the "New Page After" attribute for the detail section.

Cheers,
- Ido ixm7@psu.edu
 
Right click on the detail section in the design window and select format section. To the right of "new page after" is a button labeled "X-2". All "X-2' buttons are for conditional formmatting. Enter the following formula in there: Remainder(RecordNumber,40)=0

This will cause a Page break if the record number is perfectly divible by 40. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
also for this formula you should put a counter in the detail section to keep track of the detail lines printed...don't count records since that may be misleading.

I do it this way ... from habit

@initialize (place in report header or suitable group
header and suppress)

whileprintingrecords;
if not inRepeatedGroupHeader then //prevents resets if
numbervar counterFlag := 0; //placed in a group hdr


@LineCounter (place in the detail line suppressed)

whileprintingrecords;
numbervar counterflag ;

counterFlag := counterFlag + 1;

now...in the section expert for the detail line in the conditional "New Page After" put this formula

whileprintingrecords;
evaluateAfter({@LineCounter});
numbervar counterflag ;
if counterFlag = 40 then
(counterFlag := 0; // this will do your flag reset
true;
)
else
false;

this combines 2 steps in one...it resets your counter automatically (if you start a new group on a page this may be tricky since the counter will be reset again if placed in the group header...but you should be able to figure out where to place the resets.

Hope this helps

Jim


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top