Print Page | Close Window

Formatting fails when I suppress blank subreport

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21105
Printed Date: 28 Apr 2024 at 8:56pm


Topic: Formatting fails when I suppress blank subreport
Posted By: GrisCorp
Subject: Formatting fails when I suppress blank subreport
Date Posted: 13 Oct 2014 at 5:55am
I am using Crystal Reports XI R2.

I have a report that prints all the work orders for our shop.  I have one Group and it has 22 Details sections.  I have the Group set to 'Reset Page Number After' so that when printing multiple work orders each work order will say 'Page 1 of 1' or 'Page 1 of 2' and 'Page 2 of 2'  rather than printing 'Page 1 of 13', Page 2 of 13', 'Page 3 of 13', etc.

In one of the Details sections I have placed a subreport that prints special instructions if special instructions have been given for the selected part/customer combo.  This is the last Details section on the report.

I discovered this section can cause a second blank page if prior sections have enough data in them to push it far enough down the page.  So I decided to suppress the section if the subreport is blank.  To do this, I have performed the following steps.
  1. Right-click subreport > Edit Subreport
  2. Click File > Report Options
  3. Tick the 'Suppress Printing If No Records' checkbox
  4. Click 'OK' and return to Main report
  5. Right-click subreport > Format Subreport
  6. Click 'Subreport' tab
  7. Tick the 'Suppress Blank Subreport' checkbox.
  8. Click 'OK'

When I do this and preview the report in Crystal Reports, I can see that the Details section is no longer showing.  However, it is still printing the second page.  Only the Page Header and Page Footer are printing; there are no Details sections shown at all.  And to make matters worse, if I preview more than one work order, it takes all the Details from the second work order (a one page work order) and displays them on Page 2 of the first work order with the Page Header and Footer of the first work order.

How can I suppress this Details section when the subreport is blank, stop the second page from printing, AND stop CR from skewing the formatting?





Replies:
Posted By: DBlank
Date Posted: 13 Oct 2014 at 7:28am
sounds like in the section expert you set your last detail section up with
'new page after' checked as true.
From your description, youwant a new page after the Group footer.
and you want it conditional as
not onlastrecord


Posted By: GrisCorp
Date Posted: 13 Oct 2014 at 9:42am
In Section Expert:
None of my Details sections have 'New Page After' checked.
Group Footer has 'New Page After' and 'Reset Page Number After' checked.
Page Footer and Report Footer have 'New Page After' checked but it is grayed out.

I do want a new page after my Group Footer and I get that if I don't 'Suppress Blank Subreport'.  But then I get a page with only the blank subreport on it.


Posted By: DBlank
Date Posted: 13 Oct 2014 at 10:08am
your sub report is in Details_v, correct?


Posted By: GrisCorp
Date Posted: 13 Oct 2014 at 10:35am
Yes. 

Not sure if it matters, but I also have information in the Group Footer but the Footer is suppressed for most work orders unless very specific criteria are met and when those criteria are met many of the details sections are then suppressed allowing the Group Footer to print on the first page.


Posted By: DBlank
Date Posted: 13 Oct 2014 at 10:56am
make sure you dont have any formula conditinos for any of the new page before or new page after options on any sections.
You should only have new page after selected for GF1 and that should be using the condition
not onlastrecord
 


Posted By: GrisCorp
Date Posted: 14 Oct 2014 at 8:11am
No formula conditions for 'New Page Before' or 'New Page After' on any sections prior to or after GF1.

I clicked on the formula button for GF1 and added "Not OnLastRecord" and saved.  It did not make any difference.


Posted By: z9962
Date Posted: 14 Oct 2014 at 11:45pm
not sure if this option works with a subreport.
 
In the main report, in selection expert for Details_v enable Suppress Blank Section?


Posted By: GrisCorp
Date Posted: 15 Oct 2014 at 2:14am
That's set.  Unfortunately, even though the subreport is blank, the section is technically not blank unless the subreport itself is suppressed; it does not suppress the section.


Posted By: DBlank
Date Posted: 15 Oct 2014 at 4:25am
my guess is that you have just enough of some spill over from the combination of other sections that are not suppressed to force a second page.
Temporarily supress another detaill section that always prints to see if that stops the extra page.
Watch to see where the group footer is appearing. If you are conditionally suppressing the text but not the entire group footer, it may be the cause and it just looks like it it blank because of the suppressed text. the footer still 'prints' though.


Posted By: GrisCorp
Date Posted: 15 Oct 2014 at 5:08am
Suppressing another Details section above did fix the problem.  Unfortunately, none of the Details sections above Details_v can be suppressed.

The entire group footer is suppressed.

All changes I make,  I have been previewing within Crystal Reports itself.  On a whim I decided to run the work order report like my users would: through an intranet site using Crystal.net.

In Crystal.net, the same work order has pushed the last Details section with printed data onto the second page despite that details section showing up on the first page when previewed in CR itself.

It seems suppressing the blank subreport is not going to cause the problem I feared it would.  As long as there is valid work order data on the second page I'm OK with it.  I just didn't want a blank (except for header and footer) page or for it to print the Details from a second work order with the Header info of the first and the Footer info of the second.

After testing it in Crystal.net, I was thinking about how suppressing an earlier section fixed it and went back and decided to shrink the size of the subreport and its Details section down nearly to slivers.  The subreport is set to 'Can Grow'.  This fixed the problem when previewing it in CR.  It no longer prints the second blank page and with 'Suppress Blank Subreport' checked it no longer combines the two work orders.

So, even though the Details section was suppressed, the section was still was too high to fit on the page which caused CR to freak out.

At this point, I'm going to call this resolved.  If a user stumbles across a combination of two or more work orders that causes this issue when the report is run through Crystal.net, then I'll either revive this question or ask anew.


DBlank & z9962:
Thank you both for all your time and help on this and the other questions I've asked over the last couple of days!  Y'all have been lifesavers.



Print Page | Close Window