Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: page break in multicolumn report with groups Post Reply Post New Topic
Author Message
vjcam
Newbie
Newbie
Avatar

Joined: 04 Feb 2009
Location: India
Online Status: Offline
Posts: 5
Quote vjcam Replybullet Topic: page break in multicolumn report with groups
     Posted: 04 Feb 2009 at 7:13am
I have a multiple column (4 columns) report that is supposed to display only 4 rows per page. Since I have grouped the data, each row may not neccessarily contain 4 columns. That way I cannot have a counter for each record and break to a new page after 16.
 
Please help. TIA.
 
PS. Intention behind having only 4 rows and break after that is to avoid abandoned group headers.
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2009 at 7:53am
So you are looking to make sure you have a group header on each page if there are more detail rows for that group than can be displayed on on page, correct?
Click on your Group Expert
select the group in you need to repeatedly display in the Group By window
Click on options button
Click on the options tab
Select the "Repeat Group Header on Each Page".


Edited by DBlank - 04 Feb 2009 at 7:53am
IP IP Logged
vjcam
Newbie
Newbie
Avatar

Joined: 04 Feb 2009
Location: India
Online Status: Offline
Posts: 5
Quote vjcam Replybullet Posted: 04 Feb 2009 at 8:02am
Thanks for Replying.  I already have the option checked. I shall describe my problem with following illustration
 
Page 1 of the report
 
GH1
  GH2
    X    X   X
    X    X
    X    X   X   X
   GH2
 
Page 2 of the report
 
GH1
  GH2
  X  X  X  X
  X   X  X
 
...so on
 
 
If you observe on page one, GH2 has just started but a page break occured immediately. I do not want the Group header on a page with no detail following.
 
So Ideally, I want something like this
 
 
Page 1 of the report
 
GH1
  GH2
    X    X   X
    X    X
    X    X   X   X
 
Page 2 of the report
 
GH1
  GH2
  X  X  X  X
  X  X  X
 
...so on
 
Please observe that there is no GH2 on Page 1 in the above illustration.
 
Thanks for your help again.
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2009 at 8:13am

Go into Section expert and select GF2, click on the New Page After option or to avoid a blank page at the end use the formula option as

not onlastrecord
IP IP Logged
vjcam
Newbie
Newbie
Avatar

Joined: 04 Feb 2009
Location: India
Online Status: Offline
Posts: 5
Quote vjcam Replybullet Posted: 04 Feb 2009 at 8:26am
Thank you! It seems to be working.
Another question I had originally asked was whether it would be possible to force page break after a given number of rows (say 4 in my case).
I want this basically, for uniform distribution of rows. Thanks.
 
TIA
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2009 at 8:56am
Yes. You can use a variable to do this.
If you want it to count records per page you need to reset it per page.
Create one formula (call it "Reset") to do this and palce it at the Page Header:
 
WhilePrintingRecords;
NumberVar counter := 0
 
Create another formula to count the records and place it on the details section. Call it "RecordCount" for my example or whatever you want.
WhilePrintingRecords;
NumberVar counter;
counter := counter + 1
 
In your section expert use the second formual (@RecordCount) to conditionally do a new page after by selecting
the Details section, click on the fomual edition for "New Page After" and add the formula
Note that this would move your group footers to the next page as well...
IP IP Logged
vjcam
Newbie
Newbie
Avatar

Joined: 04 Feb 2009
Location: India
Online Status: Offline
Posts: 5
Quote vjcam Replybullet Posted: 04 Feb 2009 at 7:54pm

This formula wont work for me as all columns may not display always. It can vary from 1 to 4. So if I use the aforementioned counter to break at 16(assuming 4*4 per the formula), result will be as follows

Page 1
GH1
  GH2
   X X
   X X X X
   X
   X X X*  
   X X X X
   X X
 
*Note that at this point the counter will just be 10 though the number of rows are already 4. So it will continue to diplay in the next line.
 
Is there any solution to this? Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2009 at 9:19pm
Sorry but I am a little confused. You want a page break after a max of 4 detail rows correct? The above will give you that process. In your example the XX areas are one detail row so the * will be at counter =4. The counter is for rows not columns in the rows. You have to use it with the other suggestions to get your overall results but it will add in the max of 4 details per page.
I will be unavailable for a few days so I hope this clears it up for you :)
IP IP Logged
vjcam
Newbie
Newbie
Avatar

Joined: 04 Feb 2009
Location: India
Online Status: Offline
Posts: 5
Quote vjcam Replybullet Posted: 04 Feb 2009 at 9:35pm
My bad- I did not tell you it was a multi column report.
I figured out a way based on the formulae you suggested. Thanks :)
 
 
IP IP Logged
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