Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: group on new page Post Reply Post New Topic
Author Message
passaia
Newbie
Newbie


Joined: 01 Jun 2011
Online Status: Offline
Posts: 3
Quote passaia Replybullet Topic: group on new page
    Posted: 01 Jun 2011 at 8:18am

Hello, I'm trying to create a report where the group changes the page only if there is no space on the same page for details.

with keeptogheter I saw that page change only if the group does not fit completely on the same page, while without keeptogether it could happen that the last line written on your page is the header of the group.. I would like to avoid this case, the group must be written on the same page only if there is at least one line of detail on the same page, otherwise he must go to the new page..


is it possible?
where am I wrong?

Thank you and sorry for the banality of the question, it's driving me crazy!

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Jun 2011 at 4:18am

the only other option is line counting, but this can be hit or miss if you have can grow on for a field.  with line counting, you could put a formula in the new page before in the section expert that will force the new page if there isn't enough room as determined by you.

 
HTH
IP IP Logged
passaia
Newbie
Newbie


Joined: 01 Jun 2011
Online Status: Offline
Posts: 3
Quote passaia Replybullet Posted: 02 Jun 2011 at 4:27am

thanks for the answer!

do you have any idea of the formula you suggest??
i don't see anything about the free available space of the page!
thanke you very much!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Jun 2011 at 6:56am
this is where it gets difficult...
print the report, count the lines in the area to be displayed
are group headers/footers larger/smaller than the details
take a best guess and everytime a header/footer/detail is displayed increment a counter (i like shared variables, but global would work)
 
then in the section expert, compare the value of the counter against the 'max' (the number that you counted) and if needed force a new page.
 
the section expert formula would look something like:
shared numbervar counted;
(25 - counted) < 2
 
25 is made up, 25 lines to the page. 
counted, how many lines have already been displayed.
2  1 line for the header + 1 line of detail
 
HTH
IP IP Logged
passaia
Newbie
Newbie


Joined: 01 Jun 2011
Online Status: Offline
Posts: 3
Quote passaia Replybullet Posted: 02 Jun 2011 at 7:58am
excuse me..
I don't know where I could declare and increment a variable.. could you explain me better.. as a child please??
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.