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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect page break / header print / footer print

Status
Not open for further replies.

EdNL

Programmer
Jun 27, 2007
4
NL
Hi,

I use Clarion 6.3 PE 9054 with the ABC templates.
On a report I want the first page to have a different header than the 2nd to 999th page.

The problem is that the first page has a big header which occupies about 30% of the page, whereas the 2nd page has a small header which only occupies 5% of the page.

I know I can change the header contents during runtime. I also know I can change the header size during runtime. No problem so far.

When I reduce the size of the header I also want the detail section to grow and move up. However, when I move the detail section up after the first detail is printed using:
Code:
target{prop:ypos}   = target{prop:ypos} - moveup
, it will overprint the large header on the first page. I.e. I moved the detail section up too early...

So, I need to know when the page has ended, i.e. when the detail section is finished and the footer and form have printed, so I can change the detail afterwards without messing up the first page.

The header contents and height I can change immediately after the first run-time has printed.
The detail ypos and height can only be changed when the first page detail section is completed. What's the right event/embed-point to do this?

While I'm writing this I think I've found a solution:
I will let the detail section overlap the header section, i.e. I let the detail section start way too high. I add an extra detail band which has a height of the height difference between the 1st page header and 2nd page header.

I add a byte variable: onfirstpage=1
In the TakeRecord-embed (before parent-call) I can print the empty detail like this:
Code:
IF onfirstpage
  PRINT(RPT:dummydetail)
  DO ChangeHeader [red]! alters the header and decreases its height
  ! There is no need to change the detail size and ypos as 
  ! it's already high enough for the 2nd page header[/red]
  onfirstpage=false
.

Even though this will probably work, it's not the most elegant option. So the question remains: How can I detect a page break or a header-print or a footer-print? (perhaps it just isn't possible?)
 
Hi!

Clarion's report engine has no way of signaling a page-break. If you are using Fixed detail bands, you can estimate the page break by adding all the detail band heights as it is being printed and compare against the total printable area. Although
there exists a PAGENO(Variable) attribute, I have never got it to work.

Regards
 
Hi ShankarJ.. Thank you for the info..
I use several different variable-height detail bands, so the calculating won't work.. The solution I describe in my question works okay though..
 
Hi!

Once the first detail is printed the header is also printed and any change to the header will start from the second page. So, for your need your solution is fine. But there is no standard way to find out a page break. Let's say you have some local variables which you want to reset/process on a page-break. That's difficult with variable length bands.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top