Are Page Breaks in Reports Arbitrary? (2 Viewers)

TheSearcher

Registered User.
Local time
Today, 05:44
Joined
Jul 21, 2011
Messages
304
I have a report consisting of a few subreports. In certain instances a subreport will appear on the following page (or several spaces down from the sub above it) for no obvious reason. I changed Keep Together to "No" in the report footer and this resolved one occurrance. Does anyone know how I can control the spaces and page breaks on this report?
Many thanks,
TS
 

AHeyne

Registered User.
Local time
Today, 11:44
Joined
Jan 27, 2006
Messages
92
Sounds to me like the data contained in the report causes this behaviour in these particular cases.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:44
Joined
Oct 29, 2018
Messages
21,473
Try reducing the size of all your subreports to a minimum height and make sure it's set to Can Grow = Yes. Then, stack all your subreports close to each other.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:44
Joined
Feb 19, 2002
Messages
43,275
Page breaks are not arbitrary but as you can imagine, nested page breaks become pretty complex.

1. make sure you have no extra space at the top or bottom of the section of the main report that contains the subreport report.
2. make sure you have no extra space at the top or bottom of the main report section of the subreport or any other section.
3. Check the "keep together" property for ALL sections of both the main and subreport.
4. try selecting different data to see if it is the data as @AHeyne suggested
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:44
Joined
Feb 28, 2001
Messages
27,186
Every section has that "Keep Together" option. There is also a general term called "orphan" that, for anything in print, means a single line that is part of a larger element but the element breaks after the 1st line (leaving a top orphan) or just before the last line (leaving a bottom orphan). I'm not sure about controlling that other than perhaps writing some complex event code to dynamically force or prevent a break, or trying various statically declared combinations of KeepTogether or ForceNewPage as appropriate.

The "several spaces down" part sounds like you might have blank lines somewhere that you didn't realize you had, or might have blank records in a detail section such that the lines appear empty but actually have spaces.
 

TheSearcher

Registered User.
Local time
Today, 05:44
Joined
Jul 21, 2011
Messages
304
Thanks everyone. I tried all suggestions plus I set the "Can Shrink" property to "Yes" on each subreport. No change.
I didn't test changing the data because I need the report to be consistent regardless of what data I'm using.
When Access formats the report and sends it to Print Preview there must be some property (or something) that tells it when to add spaces or a page break. Does anyone know what this property is?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:44
Joined
Oct 29, 2018
Messages
21,473
Just a guess, but try adjusting the margins?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:44
Joined
Feb 19, 2002
Messages
43,275
I didn't test changing the data because I need the report to be consistent regardless of what data I'm using.
The point was to identify what might be causing the issue, not to actually change your report. Are you sure that the recordset does not include "blank" records? Open the query by itself and make sure it is sorted in the same sequence that the report is sorted in.
 

TheSearcher

Registered User.
Local time
Today, 05:44
Joined
Jul 21, 2011
Messages
304
Thanks Pat. All of the queries used for my subreports have 1 blank field at the bottom (see attached). But not all are problematic. I will check the sorting now. Appreciate your help!
1705348637964.png
 

TheSearcher

Registered User.
Local time
Today, 05:44
Joined
Jul 21, 2011
Messages
304
@theDBguy - Can you please elaborate on your last suggestion? There is a property called Show Page Margins. The choices are Yes or No. Is this what you mean? The report itself is right at the edge of all subreports therin.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:44
Joined
Oct 29, 2018
Messages
21,473
@theDBguy - Can you please elaborate on your last suggestion? There is a property called Show Page Margins. The choices are Yes or No. Is this what you mean? The report itself is right at the edge of all subreports therin.
Sorry, that's not what I was thinking about. I was thinking the report will render as much it can fit in a page based on your margin settings. Based on whether you have Keep Together or not, it might push some data that can still fit onto the next page and produce gaps.
 

TheSearcher

Registered User.
Local time
Today, 05:44
Joined
Jul 21, 2011
Messages
304
I resolved this by resizing all of the subreports within the main report. It seems that some were overlapping slightly. Not sure why this would cause extra space - but problem solved.
Thank you all!!!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:44
Joined
Oct 29, 2018
Messages
21,473
I resolved this by resizing all of the subreports within the main report. It seems that some were overlapping slightly. Not sure why this would cause extra space - but problem solved.
Thank you all!!!
Glad to hear that, but that was basically what I was saying originally. Cheers!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:44
Joined
Feb 19, 2002
Messages
43,275
It seems that some were overlapping slightly. Not sure why this would cause extra space - but problem solved.
There are warnings in various help entries that overlapping controls cannot resize or show/hide correctly. Sorry, I should have mentioned that.
 

June7

AWF VIP
Local time
Today, 01:44
Joined
Mar 9, 2014
Messages
5,472
The blank field showing in query image is just the new record row that shows in an editable table or query. It is not a blank record that will include in report output.
 

Users who are viewing this thread

Top Bottom