Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Hide headers in subreports Post Reply Post New Topic
Author Message
Dvana
Newbie
Newbie


Joined: 30 Jun 2009
Online Status: Offline
Posts: 4
Quote Dvana Replybullet Topic: Hide headers in subreports
     Posted: 07 Jul 2009 at 6:40pm
All right, I actually have one that I haven't been able to answer with the search bar.
 
So I've got some lovely reports, with headers and footers. I want to place them as subreports. Obviously, those headers and footers make a mess of my 'main' report. Thing is, I want to be able to see those headers and footers when the subreport is 'active.'
 
Is there any way to hide a subreport's headers and footers in the 'main' report view, and reveal them when I drill down to examine the subreport?
 
Thanks either way for the information; even a 'no' means I can stop chasing my own tail on this one.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Jul 2009 at 8:18pm
someone else may know of an answer but I believe the answer is no. You need a field that changes when a subreport is opened via the main report and I have not found that data item yet. I had tried using drilldowngrouplevel as a shared variable but it does not alter on a sub report opening.
IP IP Logged
Dvana
Newbie
Newbie


Joined: 30 Jun 2009
Online Status: Offline
Posts: 4
Quote Dvana Replybullet Posted: 08 Jul 2009 at 9:18am
Your attempts inspireed me, and I've got it working... kinda.
 
I created a formula field called ReportLevel and set it to 1 in the subreport (just typed 1 in the formula), 0 in the main report, and made it a linked variable. Set the subreport's header and footer to hide when {ReportLevel} < 1. So far so good. I can run the report and it hides the subreport header, when I click on the subreport and make it active it reveals the header. I have confirmed that ReportLevel is defining itself properly, 0 at the report level, 1 when the subreport is 'active.'
 
Great, right? Except here's where my ignorance shows, because for reasons I don't understand it's dumping ALL the rest of my data. The subreport shows up as an empty bar, as if I had passed it date parameters for which there is no data. When I click on the subreport, the header and footer show, but there's no data and the charts are empty boxes.
 
I know that the data is there, because I've run it with the same data parameters without the ReportLevel trick in place and it populates just fine. What am I conflicting with here that makes it go all crosseyed? I've got to be doing something wrong.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jul 2009 at 9:38am
Sorry, having a little trouble following your process here.
In the main report you have a formula called ReportLevel as:
0
In the sub Report you have a formula Field called ReportLevel as:
1
What do you mean you set this up as a linked variable?
IP IP Logged
Dvana
Newbie
Newbie


Joined: 30 Jun 2009
Online Status: Offline
Posts: 4
Quote Dvana Replybullet Posted: 08 Jul 2009 at 10:51am
It passes ReportLevel as parameter Pm-@ReportLevel. It's passing that variable that seems to make it all work; when I don't, the chart data shows up, but so does the header.
 
However (ah-ha,) I'm beginning to think that this might not be working at all; I've got it to the point that it's giving my my data when I activate the subreport (by unchecking "select data in subreport based on field"), but the box in the main report is still empty. It's a refrigerator light problem; since it isn't acutally giving me a look at the report, I have no way of knowing whether or not the parameters are being passed and processed correctly.
 
I'm essentially wiggling around and seeing where it takes me at this point. I'll drop something here if anything changes.
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