Expanding the page footer on a report's last page
I have a report where I sometimes need to put in a variable size text in the footer of the last page.
There was already some working code in the OnBeforePrint callback to show some more objects on the last page:
I tried to put in the resizing in this block but nothing happened, probably becasue it is too late to resize the page footer at that stage.
Instead I put the code in OnBeforePrint callback of the page header. At first I forgot to add the "if <Page> = <TotalPages>" condirtion and then it worked if I had a one page report.
After adding the last page condition it stopped working again. My guess is that TotalPages cannot yet be calculated at that point.
Anyone got a solution to this dilemma?
There was already some working code in the OnBeforePrint callback to show some more objects on the last page:
  if <Page> = <TotalPages> then
  begin             Â
    ...
  end;
I tried to put in the resizing in this block but nothing happened, probably becasue it is too late to resize the page footer at that stage.
Instead I put the code in OnBeforePrint callback of the page header. At first I forgot to add the "if <Page> = <TotalPages>" condirtion and then it worked if I had a one page report.
After adding the last page condition it stopped working again. My guess is that TotalPages cannot yet be calculated at that point.
Anyone got a solution to this dilemma?
Comments
Or does it only work before any rendering is done?
If the page footer is not resizeable after the first page is rendered I need to find some other solution. Making the page footer large enough to suffice for the last page would mean a lot of wasted space on all the other pages.
first make the report 2 pass, so you have totalpages available,
write code in the oap event of the page header to test if you are on the final pass
and the amount of freespace left then if enough space then you can alter the top and height of the page footer and it's objects
be careful as you can widow objects to the page when you go back to origianl size.
you need to reset the page footer in its oap event after printing, or when starting the report or your size will be wrong for the other pages.
What to do if there isn't enough free space to fit the larger pagefooter? Is there a way to add one more page?
it should be used to contain things like page#, totlapages, date printed etc..
it is better to use either a footer, groupfooter, column footer, or child band (can be unattached),
as these can be adjusted well beforee the end of the output(visibility,and position).