Results 1 to 8 of 8
  1. #1
    rayc is offline Novice
    Windows XP Access 2002 (version 10.0)
    Join Date
    Dec 2005
    Location
    Montreal, Canada
    Posts
    19

    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

  2. #2
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    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?

  3. #3
    rayc is offline Novice
    Windows XP Access 2002 (version 10.0)
    Join Date
    Dec 2005
    Location
    Montreal, Canada
    Posts
    19
    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!

  4. #4
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    Do your subreports all have the same layout? If so, we may be able to get creative using a UNION query for your source...

  5. #5
    rayc is offline Novice
    Windows XP Access 2002 (version 10.0)
    Join Date
    Dec 2005
    Location
    Montreal, Canada
    Posts
    19
    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!

  6. #6
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    That's OK. Can you post the SQL for each query?

  7. #7
    rayc is offline Novice
    Windows XP Access 2002 (version 10.0)
    Join Date
    Dec 2005
    Location
    Montreal, Canada
    Posts
    19
    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

  8. #8
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    Glad you got it working, Ray

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-12-2009, 09:55 AM
  2. Access and Web page
    By mahlambane in forum Access
    Replies: 1
    Last Post: 11-18-2008, 11:43 AM
  3. Hiding subreports
    By aouellette in forum Reports
    Replies: 0
    Last Post: 09-12-2008, 08:02 AM
  4. Page Footer Top
    By RHall in forum Reports
    Replies: 3
    Last Post: 12-15-2005, 09:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums