General information
Category:
Reports & Report designer
Title:
ReportListener.PageNo not accurate?
Environment versions
Network:
Windows 2000 Server
Hi Y'all,
Any idea if .PageNo is accurate during the processing of a report - at least at the detail row level?
My client has a printout where a "notice" ("Minimum Guarantee") prints part way through the report with "payments" before and after this "notice" line. They do not want this line to print as the very first line on the 2nd or 3rd page (etc) of the report (kinda like not wanting a subtotal line to print at the top of a page - looks funny because all the detail lines are on the previous page).
Bo Durban gave me some good ReportListener code that "bumps" detail lines from one page to the next if they are too close to the bottom of the page. The code worked "mostly" but it gets thrown off when there is a summary printing for the report (the code he suggested checks the value of .MaxHeightAvailable and if there is not enough room to print the payment row plus the "notice", they both get bumped to the next page).
So I changed tactics and instead did a two pass where I check to see if the payment just before the notice falls on the same page as the notice and if it does not, then the notice must be at the top of the next page e.g. payment of $500,000.00 falls on page 2 and "Minimum Guarantee" falls on page 3 and therefore, we should bump the payment ahead so they both fall on page 3 (on the next pass).
Trouble is, when I ran it the test, both of the rows had a value of 2 for the pageno (as pulled from the report object .PageNo). Note that I did the default code for .Render() first figuring that I would have to render the object before the .PageNo would be updated.
So is the page number not incremented after running .Render() when a detail overflows onto the next page?
Or maybe I cannot rely upon .PageNo and have to do this a totally different way.
Thanks,
Albert
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only