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!

Data report - number of pages

Status
Not open for further replies.

MangroBongacello

Programmer
Mar 20, 2001
189
SI
Hi,

is it possible to determine the number of pages to be printed before using DataReport.PrintReport?

Namely, what I need to do is I need to set the top margin for the first page to some value and top margin for the remaining pages to another value. I was thinking I could first print page 1 (DataReport.PrintReport, rptRangeFromTo, 1, 1), then set the top margin to another value and then print remaining pages (Datareport.PrintReport, rptRangeFromTo, 2, 500). But this only works if the report is > 1 pages long, otherwise in prints the first page on the second PrintReport again, although it says From page 2 (I guess this is a bug). So if I could get the number of pages report will have, I could use different procedures if report is 1 page long and another if report is > 1 pages long.

Any ideas?

Or maybe, does someone have a cmpletely different solution to my TopMargin problem.

Thank you
Mangro
 
Depending on how you get your recordset, you can get a count of the recordset and divide by the number of records per page


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Thanks johnwm for your reply but the problem is that the length of the report does not depend only on record count, users can create custom report footer text that can be one or more lines long so there's not always the same num of records on one page.

Mangro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top