Print Page | Close Window

Forcing a new page after x number of lines

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=15846
Printed Date: 26 Apr 2024 at 12:46pm


Topic: Forcing a new page after x number of lines
Posted By: dkalsow
Subject: Forcing a new page after x number of lines
Date Posted: 09 Mar 2012 at 9:36am
Good Afternoon,
 
Does any know how to force a new page after X number of detail lines have been printed?  I can not allow crystal to do it since I am only allowed a certain number of lines per page.
 
 


-------------
Thanks :)
dkalsow



Replies:
Posted By: lockwelle
Date Posted: 12 Mar 2012 at 9:00am
if you have Can Grow set on any cell, all bets are off...CR does not give any methods to interrogate a cell and see how tall it is (ie if word wrap has occurred).
 
Unfortunately, the most common method is to put a counter of some sort (I like shared variables) so that each line of detail counts.  In the Section Expert, in page break before, x-2 button put something like:
shared numbervar lineCount;
lineCount > 25 //or whatever value you want
 
in the page header you would want something like:
shared numbervar lineCount :=0;
""  //hides the reset
 
in details
shared numbervar lineCount;
lineCount := lineCount + 1;
""//hides the increment
 


Posted By: dkalsow
Date Posted: 12 Mar 2012 at 10:27am
I really don't care if the cell grows or not (even though it cannot).
 
If I use the linecount variable then how do I for a new page when the line count = X?


-------------
Thanks :)
dkalsow


Posted By: lockwelle
Date Posted: 13 Mar 2012 at 4:53am
in the x-2 button of the new page before in the section expert...
 
shared numbervar lineCount;
lineCount > x  // x is the number of lines that are allowed on the page.
 
this is how CR forces a page break, as you tell it that you want a page break when there as x lines...and when there is, CR makes the page break.
 
HTH



Print Page | Close Window