How to determine available free space on the actual page?
I'm working on an invoicing application.
After the last order item, I'd like to print an advertizing either as
a region or a sub-report (containing a RTF component).
We now habe different customer (of our software, not of the
end-customer getting that invoices) demands:
1. some say: always print the ad; that's fine
2. other say: only print the ad, if there is enough free space; don't
waste my company paper or increase my postage fees by beginning a new
page only for the ad.
So, how can I determine, that there is enough free space on the page
to fit for sub-report (or region)? I would then control the .visible
property with this check
Regards
Gunther
After the last order item, I'd like to print an advertizing either as
a region or a sub-report (containing a RTF component).
We now habe different customer (of our software, not of the
end-customer getting that invoices) demands:
1. some say: always print the ad; that's fine
2. other say: only print the ad, if there is enough free space; don't
waste my company paper or increase my postage fees by beginning a new
page only for the ad.
So, how can I determine, that there is enough free space on the page
to fit for sub-report (or region)? I would then control the .visible
property with this check
Regards
Gunther
This discussion has been closed.
Comments
See my reply to your previous post about the group footer on every page. The
downloadable example contains a method called CheckSpaceLeftOnPageForGroup
that contains the calculation. Here is part of that calculation. Try to use
the Band.BeforePrint event to check the space available and toggle the
visibility of the object.
var
ldAvailableSpaceInInches: Double;
liAvailableSpace: Integer;
begin
Result := False;
// microns
liAvailableSpace := ppReport1.PrinterSetup.PageDef.mmPrintableHeight -
ppReport1.Engine.PrintPosRect.Top;
// inches
ldAvailableSpaceInInches := ppFromMMTHousandths(liAvailableSpace,
utInches, pprtVertical, ppReport1.Printer);
ldAvailableSpaceInInches := ldAvailableSpaceInInches -
ppFooterband1.Height;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com