Solved

suppress main reports page header

Posted on 2006-10-30
17
2,672 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
ID: 17833414
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
ID: 17833731
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
ID: 17833754
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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:zafridi
ID: 17833790
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
ID: 17833825
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
ID: 17833905
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
ID: 17833963
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
ID: 17833995
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
 

Author Comment

by:zafridi
ID: 17834031
k no problem i got it...i got rid of it.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 17834237
Glad I could help.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17834861
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
ID: 17836910
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
ID: 17836933
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
ID: 17843485
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
ID: 17843921
>>> 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
ID: 17845085
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
ID: 26031859
I have applied the same procedure but it is not working.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 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