Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Can subreport print without page header/footer? Post Reply Post New Topic
Author Message
wanderingbob
Newbie
Newbie
Avatar

Joined: 12 Dec 2007
Location: United States
Online Status: Offline
Posts: 9
Quote wanderingbob Replybullet Topic: Can subreport print without page header/footer?
     Posted: 12 Dec 2007 at 12:27pm
Greetings,
 
I'm using Crystal Reports XI, Visual Basic .NET 2005 and Oracle 10g.  I only edit report definitions in Crystal Reports itself, never in the editor embedded into VB.NET.
 
I am creating a report that displays three essentiallly unrelated sets of information.  According to everything I have read, the way to do this is to display one set of information on the main report and the other sets on subreports.  I have the first set of information in the main report and the subreports in report footers.
 
The desired information is being displayed, but I don't want the title and column headings on the page header from the main report to be displayed on the subreport's page.  Is there any way to have each subreport output on a separate page without any elements from the main report (including the page header and page footer)?
 
I know that I could set up the subreports as completely separate reports which would open in separate document windows, but I also know that my users would object to having to navigate to each of the document windows to view the information and perform an action such as printing.
 
Thank you,
Bob
Any sufficiently advanced technology is indistinguishable from magic
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 13 Dec 2007 at 12:01am
There is a suppress property that can be used in combination with conditional formatting formulas to hide these sections. But the probelm is to writing the formula properly. What you'll need to do is use a global variable that is shared between the main report and the subreports. Create a formula in the top of the main report to set it to zero. Then in the subreport's header, set it to 1. For the subreport header in the main report, suppress it when the variable is 1. That way it gets suppressed when the subreport is printing. You're going go have to play around with this a bit because you are basically flipping this variable back and forth between 0 and 1 and only suppressing the header when it is equal to 1. Might get a little tricky keeping track of what the variable is. I suggest printing the variable out in the main report and subreport so you can see how it flips around and confirm that you are setting it correctly.

I cover lots of tips and tricks for using subreports and manipulating data in Chapter 9 of my book Crystal Reports Encyclopedia.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
wanderingbob
Newbie
Newbie
Avatar

Joined: 12 Dec 2007
Location: United States
Online Status: Offline
Posts: 9
Quote wanderingbob Replybullet Posted: 13 Dec 2007 at 6:45am
I will attempt to create a variable shared between the main report and the subreports and use it to control supression of the page header (I'm not currently using a page footer, but the same method should apply to that as well).
 
Thank you for the suggestion!
 
Bob
Any sufficiently advanced technology is indistinguishable from magic
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