Solved

suppress main reports page header

Posted on 2006-10-30
17
2,671 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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