Solved

Report Ignoring Page breaks in subreport

Posted on 2004-08-27
7
331 Views
Last Modified: 2008-03-06
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
Comment
Question by:Peepsalot
  • 4
  • 3
7 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 11919828
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
 
LVL 2

Author Comment

by:Peepsalot
ID: 11931881
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
 
LVL 2

Author Comment

by:Peepsalot
ID: 11932544
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 49

Accepted Solution

by:
Gustav Brock earned 100 total points
ID: 11952513
Have a look here:

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

Looks like what you are after.

/gustav

0
 
LVL 2

Author Comment

by:Peepsalot
ID: 11965575
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
 
LVL 2

Author Comment

by:Peepsalot
ID: 11965588
You know what they say though  "Those are the breaks" ;-)
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 11965606
Certainly!

/gustav
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

861 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