Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-07-2018, 10:30 PM   #1
mminieri
Newly Registered User
 
Join Date: Jul 2018
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mminieri is on a distinguished road
How to prevent subREPORTS from breaking across pages?

I have a dynamic REPORT, the contents of which are determined by "sections" (subjects) of information needed
and selected by a user from a FORM. These "sections" are TABBED PAGES on the form and there are about 30 of them.
Every RECORD can thus have a siginificant quantity of different combinations of "sections". On PREVIEW / PRINT
each "section" is a subREPORT however, ONLY THOSE WITH DATA appear on the report. No subreport consumes an entire
page and - depending on their heights (variable) - more than one can fit a single page. The number of pages needed
is not important to me. The structure is such that there are no large blank spaces or blank pages on the REPORT.
All of this works very well (I'm running Access 2016).

There is only 1 PROBLEM ISSUE at this point: If the last subREPORT on a page will not fit entirely on that page, that
subREPORT gets broken so that PART of the subREPORT appears at the top of the next page. The OBJECTIVE of this Post is
to find a solution that will force the subREPORTS move - as a complete single section - to the next page instead of
breaking. The following typical solutions do not work;

* "KeepTogether" does not work on "SUBreports" no matter where it is applied.

* I cannot use GROUPING/SORTING because the limit is about 20 using headers and footers, and I have about 30.

* Simply inserting a conventional "pagebreak" on the report would simply add pages and bloat the report to the extreme.

I am actually quite a novice at developing with this complexity, so any solution will need to be conveyed with the
complete coding to try please. I don't need suggestions like having less "subreports". There are indications online that
my objective is "IMPOSSIBLE" and maybe it is. I suspect that a solution - if there is one - will be a long, complex code
the can somehow determine the HEIGHT of the subREPORTS and the space available for it, then force a page break if it wont fit.

mminieri is offline   Reply With Quote
Old 07-08-2018, 02:59 PM   #2
Ranman256
Newly Registered User
 
Join Date: Apr 2015
Location: KY,USA
Posts: 3,052
Thanks: 0
Thanked 668 Times in 653 Posts
Ranman256 will become famous soon enough Ranman256 will become famous soon enough
Re: How to prevent subREPORTS from breaking across pages?

You can't.
At some point the sub rpt must spill over the page.
It cannot fortell the future.
Ranman256 is offline   Reply With Quote
Old 07-08-2018, 09:03 PM   #3
JHB
Have been here a while
 
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,299
Thanks: 2
Thanked 1,951 Times in 1,908 Posts
JHB has a spectacular aura about JHB has a spectacular aura about
Re: How to prevent subREPORTS from breaking across pages?

Could you post your reports and some sample data that shows your problem, (zip it because you haven't 10 post yet)?

__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
JHB is offline   Reply With Quote
Old 07-08-2018, 10:30 PM   #4
ridders
Part time moderator
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 6,099
Thanks: 83
Thanked 1,500 Times in 1,400 Posts
ridders is just really nice ridders is just really nice ridders is just really nice ridders is just really nice ridders is just really nice
Re: How to prevent subREPORTS from breaking across pages?

Quote:
Originally Posted by Ranman256 View Post
You can't.
At some point the sub rpt must spill over the page.
It cannot fortell the future.
Reports 'foretell the future' all the time by printing 'Page 1 of 5' etc in the footer.
You can also optionally restart the numbering after each group has completed.
Access does that by making 2 passes before printing.

Having said that, I have a report with up to 10 small subreports that I tried to prevent breaking across pages. The only way I managed to do so was to use carefully placed page breaks

BUT a solution was suggested at another forum where this was cross posted.
Place each report in its own section.
For more info, see https://social.msdn.microsoft.com/Fo...orum=accessdev

The issue then becomes the number of sections available on a report but its unlikely to be an issue.
You can have up to 754 controls or sections over the lifetime of a report
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

New example databases:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

-----------------------------------------------------------------------------------
nil illegitimi carborundum est

Last edited by ridders; 07-08-2018 at 10:53 PM.
ridders is offline   Reply With Quote
Old 07-09-2018, 06:19 AM   #5
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,534
Thanks: 55
Thanked 2,083 Times in 1,995 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: How to prevent subREPORTS from breaking across pages?

here is a sample dynamic report (MainReport).
there are two subReports (AA) and (BB).

view the mainreport in print Preview.
see that BB subreport fits in the same
page.

close the report and add more records to table BB.
view the report again.

see the code behind sub report AA (first sub report).
Attached Files
File Type: zip sampleDynamicReport.zip (33.6 KB, 6 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is online now   Reply With Quote
Old 07-11-2018, 10:07 PM   #6
mminieri
Newly Registered User
 
Join Date: Jul 2018
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mminieri is on a distinguished road
Re: How to prevent subREPORTS from breaking across pages?

Thanks....I'll take a crack at it.

mminieri is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to format even numbered pages completely differently than odd pages? zee3are0 Reports 1 04-29-2011 09:49 AM
Report with subreports printing blank pages when no data pityocamptes Reports 3 12-15-2010 07:48 PM
Pages breaks - so that data isn't spread over 2 pages Maranna Forms 3 06-22-2009 09:06 AM
SQL and Data Access Pages and ASPX pages CyrusMacsen ASP and ASP.NET 2 12-13-2005 09:09 AM
Breaking down SQL's disgruntled Queries 4 08-04-2001 09:35 AM




All times are GMT -8. The time now is 09:22 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World