Keeping headers and detail together

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I force the header to print on the next page (instead of bottom of page) when there is not enough room left on the page for the detail to print (like widows and orphans in word processing)?
 
One way to achive this is to use a subreport. If the heading and details are
in a subreport that is in a section of the main report, you can set the main
report's Keep Together property, so the subrecords and their heading will be
printed together.

Another approach is to use code in the Format event of the group header to
check the Top property of the report. It indicates how far down the page you
are, in twips (1440 twips = 1 inch). You can the force a page break if there
is not enough room for the header section and the detail setion on this
page. Provided your sections don't have Can Grow or Can Shrink turned on
this, is not too difficult to calculate.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Bettyboo said:
How do I force the header to print on the next page (instead of bottom of
page) when there is not enough room left on the page for the detail to print
(like widows and orphans in word processing)?
 
Bettyboo said:
How do I force the header to print on the next page (instead of bottom of page) when there is not enough room left on the page for the detail to print (like widows and orphans in word processing)?


You also might want to try using the Sorting and Grouping
window to set the group's KeepTogether property to either
Entire Group or With First Detail. Don't confuse this
KeepTogether setting with the one for the header section.
 
Further to Allen's point, what changes if the 'Can grow' or 'Can shrink' properties are set to true?

Chops
 
Back
Top