Solved

Report Ignoring Page breaks in subreport

Posted on 2004-08-27
7
328 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 49

Accepted Solution

by:
Gustav Brock earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
You know what they say though  "Those are the breaks" ;-)
0
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
Certainly!

/gustav
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now