Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Page Break, Based on Sub report value Post Reply Post New Topic
Author Message
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Topic: Page Break, Based on Sub report value
     Posted: 02 Sep 2009 at 11:01am
Hi Again!
It's been awhile :)
Still using CRXI, and trying to modify an old report
 
This report is a crosstab report showing results to different panels for the selected dates for that person.
 
that all works fine.
 
now if there is a "SEE NOTE" in the cross tab,
I have a sub report that brings in the comments of the note.
I have it currently set up where the xtab is in the report footer a
and the subreport comes out in report footer b.
 
between these i want a page break. but ONLY if the sub report is not null
if there is no comments. i don't want the blank page that i'm currently getting. does anyone know how i can fix this?
 
if i made this too hard to follow let me know. and i'll try to clear it up.
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Sep 2009 at 7:12am
my solution is definitely not optimal, but run the subreport twice...once to see if it returns any thing (then you can force a page break) and once to print the results
 
Can you get a flag in the main report if there is anything in the comments? That is what I would try, but I don't do crosstabs much and don't know how that might affect them.
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 7:44am
I was thinking of something similar. Maybe a shared variable as the "flag" that you can place in a section below the opriginal and do a conditional page break using it after its section. You could avoid the double sub report run that way.

Edited by DBlank - 03 Sep 2009 at 7:45am
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 03 Sep 2009 at 10:58am
Sigh,
I'll try the duel sub-reports i guess.... I was trying to avoid doing anything like that. since the report gets ran often by employees on our production server. I already attempted it the way you suggested Dblank, and it didn't work out...I think since i was trying to page break at the same section the sub-report was ran on so the variable wasn't actually there yet.
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Sep 2009 at 11:11am
If you drop the variable onto a section below and use that though?
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 03 Sep 2009 at 1:23pm
Nope. it'll let me page break that section below... but not at the subreport's section above...
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 Sep 2009 at 6:06am
Yeah, a shared variable would have the same issue, in that you need to run the run the subreport before you can determine if you need the page break.
 
The only other solution would be to figure out a way to determine if you need to run the subreport before...having a flag in the main report.  I don't know how you are getting the data, if it is from a store proc/view, you could determine if you there are comments before you get to the subreport, but if you are joining straight to the tables, I don't see an easier solution.
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 04 Sep 2009 at 9:30am
Yeaaah,
there's a SP to get the dates for the dynamic date parameter...
but it wont help me at all for the results... hmmmm.... dam
I'll try putting in another sub-report and flag then i guess... see if it doesn't slow the report down too much...
 
if it does. I might just have to deal with a blank page.... =/
If IRL is an MMO... I guess we're still in beta...
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