Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Forcing a new page after x number of lines Post Reply Post New Topic
Author Message
dkalsow
Groupie
Groupie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 65
Quote dkalsow Replybullet Topic: Forcing a new page after x number of lines
    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
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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
 
IP IP Logged
dkalsow
Groupie
Groupie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 65
Quote dkalsow Replybullet 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
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.