Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display page footer on every page of subreport on drilldown

Status
Not open for further replies.

tweetie7

Programmer
Jul 28, 2006
17
AU
I am using Crystal Reports 2008 and the reports are published to Crystal Reports Server 2008. I have a main report that includes 4 subreports. Each page of the main report displays a security message in the Page Header and Page Footer. I have now received a request that when a drilldown on subreport is done, that each page of the subreport displays the security message in the header and footer.

I can get the subreports to display the header by creating a group (with the Option Repeat Group Header on Each Page selected) based on the formula WhileReading Reocrds; " ", then suppress the section using a shared variable

shared StringVar Header;
if Header = "Show" then
true
else
false

which is used in the Subreport Format, Subreport Preview Tab Caption formula of
shared StringVar Header := "Show"

This is all working fine for the "page headers", but how do I achieve the same for a Page Footer?

Thanks
Tweetie

 
When you refer to drilldown, are you referring to opening an on-demand subreport? Or do you mean that there is a hidden section within the sub that you are drilling into? Or both?

I'm also unclear on why you would need a conditional suppression formula for the sub page header.

-LB
 
These are regular in-line subreports that just display data based on the parameter values selected in the main report. The reason I want to suppress the header on the subreport is because when the data displays on the main report (which is how the users are supposed to look at it), if it is not suppressed the header on the main report AND the header on the subreport would both display.

There is no value in the user 'drilling down' on the subreport but because there is no way to turn off the ability to 'drilldown' (that I know of), when someone does this action and displays just the subreport data on the screen, the header (and footer) should display the standard security message because one of the requirements is that this security message be displayed on ALL pages of the report that can be viewed on the screen.

The reason the message is required is because the reports display data that is not allowed to be distributed to any external agencies and the message needs to display on every page to remind all the report users of this fact (and so noone can say 'Nobody told me I couldn't share this data').


 
To create a page footer in a subreport, you have to count records and determine the number of records you want per page before a page footer and page break. Let's say it is 60. You would first insert a detail_b section and place the page footer information in it. Then add a suppression formula on the detail_b section:

remainder(recordnumber,60) <> 0

Add a formula also to detail_b->new page after->x+2 like this:

remainder(recordnumber,60) = 0 and
not onlastrecord

You should also check "Keep together" for the higher order detail section (above detail_a).

-LB
 
Thanks lbass
I was trying to do something similar, only at group level as the data in the subreport is at group level (details suppressed) using GroupNumber. Your formula is much more elegant than my If statement so I will see how I go using this.
Tweetie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top