Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Formatting fails when I suppress blank subreport Post Reply Post New Topic
Page  of 2 Next >>
Author Message
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Topic: Formatting fails when I suppress blank subreport
    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?


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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


Edited by DBlank - 13 Oct 2014 at 7:29am
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Oct 2014 at 10:08am
your sub report is in Details_v, correct?
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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
 
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet 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.


Edited by GrisCorp - 14 Oct 2014 at 8:11am
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet 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?
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet 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.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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.
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.