• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 339
  • Last Modified:

Report Ignoring Page breaks in subreport

I am stumped on something that seems like it should be very simple to do.

I have a report which contains a subreport.  If the subreport contains data, i want it to show on a new page, and if there is no data, i do not want a page break.  I have tried putting page break controls at the beginning of the subreport, and I have also tried setting force new page to "before" in the subreport's heading.  When the parent report is viewed, it refuses to page break.
I am using the Report_NoData event to set all the sections of the subreport to visible=false when there are no records.

Anyone know a simple fix for this?
0
Peepsalot
Asked:
Peepsalot
  • 4
  • 3
1 Solution
 
Gustav BrockCIOCommented:
Subreports ignore any page settings and commands when run as .. a subreport. Thus you need to move page break commands to the main report.

If the NoData event of the subreport works for you, you can use it to set a global variable to be read by the main report if a page break should be send or not.

/gustav
0
 
PeepsalotAuthor Commented:
Ok, I am trying to do what you suggested, but I can't figure out how to dynamically insert a page break.  Page break doesn't seem to have a "Visible" property that I can toggle.  Any other suggestions on how I could do this?
0
 
PeepsalotAuthor Commented:
Also, I'm not sure how this can be done, since the page break needs to be inserted before the subreport, and there is no way to tell whether the page break is needed until the NoData event has a chance to run.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
Gustav BrockCIOCommented:
Have a look here:

http://www.experts-exchange.com/Databases/MS_Access/Q_21111927.html

Looks like what you are after.

/gustav

0
 
PeepsalotAuthor Commented:
Thanks, a variation of that suggestion did eventually work for my application, I had to keep trying placing the page breaks in different "Before"/"After" configurations, in different headers, etc.  But eventually it all worked out.  Access seems to be very picky, and not so straightforward in the way it handles those breaks.
0
 
PeepsalotAuthor Commented:
You know what they say though  "Those are the breaks" ;-)
0
 
Gustav BrockCIOCommented:
Certainly!

/gustav
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now