Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Reports

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 08-31-2006, 12:51 PM
Novice
 
Join Date: Dec 2005
Posts: 17
rayc
Default Multiple Subreports with page break

I have a main report that has four subreports. I need each subreport to begin on a new page. The problem is that whenever a subreport has no data, I get a blank page at the end of my report.

All my sections have CanShrink to Yes. All my subreport placeholders have the same CanShrink to Yes. Why do I still get a blank page?

Thanks in advance.
Ray
Reply With Quote
  #2  
Old 08-31-2006, 06:08 PM
Expert
 
Join Date: Dec 2005
Location: Wilmington, DE - USA
Posts: 275
matthewspatrick
Send a message via MSN to matthewspatrick
Default

Are all of these subreports in the same section of the main report? If so, did you put in page break controls? If not, do you have the sections configured to start new pages after the section?
Reply With Quote
  #3  
Old 09-01-2006, 06:48 AM
Novice
 
Join Date: Dec 2005
Posts: 17
rayc
Default

I originally tried to put the subreports in the same section with page breaks, but that caused page breaks when subreports were empty, causing a blank page at the end, sometimes in the middle.

So I decided to create 4 separate sections (one for each subreport) and then I configured the sections to start a new page after each section. Again, that caused a blank page at the end, whenever the last subreport had no data.

The problem is that there's no way of knowing which subreport will have no data (that is always possible). Access then adds a page break.

Thanks!
Reply With Quote
  #4  
Old 09-01-2006, 09:17 AM
Expert
 
Join Date: Dec 2005
Location: Wilmington, DE - USA
Posts: 275
matthewspatrick
Send a message via MSN to matthewspatrick
Default

Do your subreports all have the same layout? If so, we may be able to get creative using a UNION query for your source...
Reply With Quote
  #5  
Old 09-01-2006, 10:11 AM
Novice
 
Join Date: Dec 2005
Posts: 17
rayc
Default

Yes, they do have the same layout but keep in mind, each subreport has very specific conditions. The queries behind each subreport are not trivial.

Thanks!
Reply With Quote
  #6  
Old 09-01-2006, 10:29 AM
Expert
 
Join Date: Dec 2005
Location: Wilmington, DE - USA
Posts: 275
matthewspatrick
Send a message via MSN to matthewspatrick
Default

That's OK. Can you post the SQL for each query?
Reply With Quote
  #7  
Old 09-02-2006, 03:21 PM
Novice
 
Join Date: Dec 2005
Posts: 17
rayc
Default

Patrick,

I solved my problem.

It was a good idea that I placed the subreports in separate sections. However, I found that I had some sections' KeepTogether property to yes.

This forced page breaks whenever the section couldn't fit on the remaining page. So I set all KeepTogether's to No. Then I placed PageBreak controls in each of the sections. With a little code behind the OnFormat of each section I set the PageBreak controls to False and/or True depending on the HasData property of my subreports.

Everything is fine now.
Thanks !

Ray
Reply With Quote
  #8  
Old 09-02-2006, 04:59 PM
Expert
 
Join Date: Dec 2005
Location: Wilmington, DE - USA
Posts: 275
matthewspatrick
Send a message via MSN to matthewspatrick
Default

Glad you got it working, Ray
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset page number and total page number for each group lisadailey Reports 1 03-12-2009 07:55 AM
Access and Web page mahlambane Access 1 11-18-2008 08:43 AM
Hiding subreports aouellette Reports 0 09-12-2008 06:02 AM
Page Footer Top RHall Reports 3 12-15-2005 06:35 AM


All times are GMT -8. The time now is 08:29 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.