cancel
Showing results for 
Search instead for 
Did you mean: 

Supress Page header while printing Subreport

hemantsavex
Explorer
0 Kudos

HI,

I have a page header, and I wanted to suppress it for specific Section called "Group Header 1" this section contains a sub-report, and whenever my sub-report goes in multiple pages, it prints the page Header on sub-reports becasue I am having one suppress condition on Page header to suppress it for "PageNumber=1"

My sub-report has its own header, and I do not want to print the report page header on it.

Is there any way by which I can suppress it for specific Section i.e. " Group Heade 1"

Note:- Both supress conditions should work.

Thanks

Hemant

Accepted Solutions (0)

Answers (7)

Answers (7)

JWiseman
Active Contributor
0 Kudos

Hi Hemant, I copied your email so you can edit the comment above to delete it. I believe that if you follow me that I can DM you as well. Regardless, I'll contact you now.

hemantsavex
Explorer
0 Kudos

Hi Jamie,

Sorry I was not available here for few days. I tried your earlier solution but it didn't worked for me.

Can you share you email address so that i can share my crystal report file. I am finding it little difficult

you can send me hi on hemant.shah1388@gmail.com.

Thanks and Regards

Hemant Shah

hemantsavex
Explorer
0 Kudos

Hi Jamie,

I tried but unable to get through it.

Few points to add here

I have group section based on Copy i.e. Original, Duplicate, Triplicate etc.

Each copy may have Single page or Multiple page based on Number of Lines in Invoice

Annexture (Subreport) should be printed after Original copy i.e. first copy.

Hemant Shah

JWiseman
Active Contributor
0 Kudos

hi Hemant, did you move everything in the main report's Page Header to the new formula based Group 1 Header? As mentioned, suppressing Page Headers with whileprintingrecords variables is not that reliable due to print-time constraints.

The only other suggestion that I can think of now is to use a 'container' report that only contains subreports. What you use now as the 'main' report becomes the first subreport. This technique is useful when dealing with stitching together multiple views of data and each view has their own headers and footers; you then don't have to worry about suppressing any main report sections based on which subreport is shown.

If you create a new 'container' report that has only a Group based on your invoice ID field, then you add your subreports to Group Header sections in the order that you want them to print. i.e. In the pics you posted, the first page (which seems to be your current main report) becomes the first subreport and there's a new page after.

The second page is your second subreport; you don't need to worry about main report Page Headers as each subreport has their own...the 'fake group' technique (on a whilereadingrecords text formula) I mentioned is used to create the individual subreport page headers.

Steps:

  1. Do a Save As for your current 'main' report.
  2. On this new copy, right click on each subreport and do a Save Subreport As and then delete the subreport.
  3. Repeat 2 for each of the subreports.
  4. Create a new report that will act as the 'container' and base this on your current data connection and add the table that has your invoice ID.
  5. In the new 'container' report add a group on the invoice ID.
  6. Add multiple Group Header 1 sections.
  7. Go to Insert > Subreport and choose the copy of the 'main' report that you made in step 1.
  8. Insert this into the first Group Header 1 section.
  9. Repeat step 7 & 8 for the remaining subreports.

If you have the need to create a Page Header for the subreports then in that subreport create a new formula

whilereadingrecords; 'outergroup';

and then create a new group based on that formula. Choose the Group > Options > Repeat Group Header on Each Page.

Hopefully this helps.

hemantsavex
Explorer
0 Kudos

Thanks Jamie,

I will try the solution given in your earlier post.

As far as your question of having subreport in that particular section is concerned is

Earlier we had the subreport at Report footer and it was working fine but issue was annexture (serial numbers) was printing at the end of report i.e. we have invoice copies namely Original, Duplicate, Triplicate etc

Our dispatch team had a requirement to print the annexture after Original Copy so that they can stapple it with Original copy and keep Duplicate and Triplicate copy.

To meet the above requirement Subreport is moved to Page Header#1

Hemant Shah

JWiseman
Active Contributor
0 Kudos

Thanks Hemant for the pics...those are very helpful.

Have a look at the sample via the link I posted earlier to see if this is roughly what you're looking for...to me it looks like it should work for the Design of your report...however, you'll probably need to make a change as I'm guessing that your Page Header info (in your 4th picture) is not suppressing in the way that you want.

Please do a File > Save As with your report so that you can retain your original report as a backup...just in case this sample method doesn't do exactly what you want.

Note that in the sample there is a Group1 based on a whilereadingrecords text formula and this is acting as a 'fake page header' so that a suppression formula can be used. The new Group is using the Repeat Group Header on Each Page option. Dealing with variables can sometimes be better using Groups vs Page Headers. I'm assuming you already tried to suppress the Page Header via a conditional suppression formula and it's not acting like you thought it should. Everything from your existing Page Header would be moved into this new outer Group Header.

See the 3 formulae on the main report that are looking after the suppression. Basically it marks the start of the subreport using a whileprintingrecords counter var and then is looking for cases where the subreport is spanning more than one page...scroll through the report Preview until the Belgium group and you'll see a case there. You shouldn't need to add anything to your subreport.

Let me know how it goes.

JWiseman
Active Contributor
0 Kudos

p.s. Is there a reason as to why the Subreport is in that particular section?

If there is only 1 invoice per report, you might be able to put the Subreport on the Group Footer instead. This would involve minimal change as well. Page Headers and Footers are then Suppressed based 'onlastrecord'. Of course, do a Save As before attempting this.

hemantsavex
Explorer
0 Kudos

HI Jamie,

Thanks a lot for the response attached herewith some picture

Picture 1 is the Crystal report in Design mode where you can see Page header, Group Header#1 and Group Header#2

Refer My remarks on each picture

Group Header#1 is where my sub report is placed.

Picture 2 is First page of my report in Preview mode (apologies hide some data due to some data security policy)

Picture 3 is Second page where you can see the Annexture which is nothing but Subreport

Picture 4 is second page of Subreport and the page where I am struggling

I hope this will clear my requirement

Thanks alot in advance

JWiseman
Active Contributor
0 Kudos

Hello Hemant, can you please attach some pictures of what your report looks like in Preview mode...i.e. the start of the Group and the next page. Also attach a picture of the Design mode of your report. Suppressing sections will depend on what's on the Main report and if there are any section underlays etc.

JWiseman
Active Contributor
0 Kudos

p.s. Here's a sample report where the 'page header' is suppressed when a Subreport in a Group Header spans more than 1 page. See if this method works for you.

Note that the 'page header' is created via a new outer Group created on a whilereadingrecords formula. This is done to avoid any whileprintingrecords var issues that can occur using Page Headers or Page Footers.