Solved

suppress main reports page header

Posted on 2006-10-30
17
2,669 Views
Last Modified: 2012-06-27
I have a sub report inside another report and the headings on the main report are page headings. When i preview the report it shows both the reports fine but on the sub report im seeing the main reports page headers. how can i get rid of main reports page headers from the sub reports. I just wana be able to see the sub-reports headers and data. thanks
0
Comment
Question by:zafridi
17 Comments
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
You'll need to use conditional suppression to suppress them while the subreport is printing.

Create a new formula and put it in the section above your subreport (you may want to add a blank report section containing nothing but this formula):

//@StartSuppression
shared numberVar HideHeaders := 1;

Create a new formula and put it in your main report's report header:

//@InitVariables
shared numberVar HideHeaders := 0;

Create a new formula and put it in the section below your subreport:
shared numberVar HideHeaders := 0;

Now use Section Expert and for the page header, click the formula (X+2) button next to 'Suppress' and enter this formula there:
(shared numberVar HideHeaders = 1)

This will suppress the page header while the subreport is printing.  Note that unless you do a page break before the subreport, the page header will still print on the first page of the subreport but not on any subsequent pages.

HTH

frodoman
0
 

Author Comment

by:zafridi
Comment Utility
thanks for ur help. my only problem is now that it doesn't display the page headers for the sub report after the first page and plus the second sub report is not coming out as i want it, it is still showing the main reports page headers. do i need to repeat the same thing for the second sub report or i need to try someting else. thanks for ur help.
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
Yes, for the 2nd subreport you can follow the same process - or if they're adjacent just move the second formula below the second report instead of below the first report.

>>> now that it doesn't display the page headers for the sub report after the first page

I thought this was what you wanted - maybe I misunderstood?
0
 

Author Comment

by:zafridi
Comment Utility
i meant to say the subreports's own page headers. its something like this

main report (all of its own page headers) then comes the subreport1(all of its own page headers on all pages) then subreport2(all of its own page headers)..thanks
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
A subreport will never print it's own page headers - that's the way Crystal works - because otherwise you could potentially have two page headers (main report and subreport) and Crystal can't handle that.

What you can do if you want, is create a second page header in your main report and then use conditional suppression on the second one so that it appears only when the subreport is printing - the opposite of what we already did with the first page header.  All you need to do is edit the suppression formula in the section expert for the second header and use the opposite formula so it would be:

   (shared numberVar HideHeaders = 1)

You can also create a third page header to show on your second report if necessary, but that's going to be more complicated overall.
0
 

Author Comment

by:zafridi
Comment Utility
it actually works but it shows it on the main report as well. is there a way that i can suppress it on the main report because all my sub reports have different page headers and also can i use the same formula with other subreport page headers as well. would it work? thanks
0
 
LVL 42

Accepted Solution

by:
frodoman earned 250 total points
Comment Utility
Sorry, change the suppression formula for the second headers to be =0 instead of =1 -- that's what I meant to say the first time.
0
 

Author Comment

by:zafridi
Comment Utility
thanks..i just noticed the page headers of the main report on the last page of the report. do u know why am i getting that. its just the headers after the last page of the entire report no data or anything. thanks
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:zafridi
Comment Utility
k no problem i got it...i got rid of it.
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
Glad I could help.
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
There is a trick you can use to simulate page header and footers in a subreport.

http://support.businessobjects.com/library/kbase/articles/c2005103.asp

mlmcc
0
 

Author Comment

by:zafridi
Comment Utility
hey frodoman,

since i have more than one subreport how do i apply that some formula to other subreports page headings.
for instance i have schedule 1 as main report then i have schedule2 as subreport1 and schedule3 as subreport2. Right now i have subreport1 page headings displaying on subreport1 but they move over to subreport3 and plus i need to show sub report3 page headings. sorry for being a pain..
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
You can use the same concept, but you'll need to take a different approach with the shared variable and conditional suppression.

Say set the variable to 0 at the beginning of the main report and suppress the first header when this is <> 0.  Set the variable to 1 before the first subreport and suppress the next header whenever the variable is <> 1.  Set the variable to 2 before the second subreport, etc., etc.

It's the same concept, just takes more attention to manage correctly.
0
 

Author Comment

by:zafridi
Comment Utility
could u plz simplify it a little more..i keep playing with it sometimes it shows one subreport fine and the other one is messed up..im not quite following the logic i guess. here is the sequence i have so far..main report (PHa, PHb, PHc),Detail, Rfa,Rfb,Rfc..PHa is for main report header which is fine..PHb supposed to show on RFb(subreport1), PHc shud show on RFc(subreroprt2)..thanks for ur help
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
>>> PHb supposed to show on RFb(subreport1)

If you mean PHb within the subreport, then keep in mind that Crystal does not ever show the page headers/footers of a subreport.
0
 

Author Comment

by:zafridi
Comment Utility
i mean i inserted new page header sections in the main report as(PHa, PHb, PHc), Pha is a header for the main report while PHb and PHc are the headers (inside the main report) that i wana show on the subreport1 and 2 respectively as page headers. is that possible?
0
 

Expert Comment

by:rajusum
Comment Utility
I have applied the same procedure but it is not working.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now