Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Force New Page

Status
Not open for further replies.

DaltonVB

Programmer
Jul 22, 2002
80
US
I have a report set up as follows:
TAB Header
Keep Together = Whole Group
Category 1 Header
Keep Together = Whole Group
Force New Page = Before Section
Category 2 Header
Keep Together = NO
Detail

I have a request from end users to have the report force new page when there is no detail info after Category 2 Header. Currently, the last line on the report before the footers could be the Category 2 Header without Detail info after it. Marketing says it looks ugly.

The format looks somthing like this:

Gold Medal /*Category 1*/

material description other stuff
COOKIES /*Category 2*/
123456 cookie blah blah /*Detail*/
789101 cookie blah blah /*Detail*/
121314 cookie blah blah /*Detail*/
Cookie Dough/*Category 2*/
I need it to not show this last Cateroty 2 Header before it breaks when there is no detail info after.
Footer info

Any idea how I can find the curent x, y on the page?
Any other idea of how to do it?

Thanks in advence
Dalton
 
try to use footers for most of your data displays
try forse new page after section for category 2 REGARDS, KUZZ

LIFE IS GREAT WHEN THERE IS SOMEONE TO HELP YOU.
DESIGNING DATABASES SINCE 2002
 
KUZZ,

"try to use footers for most of your data displays"
I need to keep the detail info in the detail so that the records will display in a continuous sheet.


"try forse new page after section for category 2 "
I also need to keep Catefory 2's together. If I forced new page there, I would have a 1000 page price list containing an average of 3 products per page.

Thanks for the info though.

Any other ideas?

Dalton

 
Hi!

Place a page break control in the header of the group in question and set the visible property to no. In the format event procedure of the Group Header, open a recordset that represents the detail you would print and then use the following code:

If rst.EOF = True and rst.BOF = True Then
Me.YourPageBreakControl.Visible = True
Else
Me.YourPageBreakControl.Visible = False
End If

When the page break control isn't visible then it won't cause a break to occur. You may need to use the same sort of logic to cancel the printing of the header in the header's print event.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Jeff,

I will try that. Will that work even if there are several pages after that? Is there a way to limit the data in the recordset to what is on that particular page so that eof of the recordset is for the number of records on that page?

Thanks,
Dalton
 
Hi!

I would think that you could get the records back by limiting the recordset using the current values for your Category1 and Category2. I have the page break trick before so I know that it will force a new page and the cancel printing should be just for the section you are on, in this case just for the group header. Test it and see what happens, because I have not used this logic before to cancel printing so I have no experience to offer.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top