Calculating PaperWidth
Hi,
I am dynamically creating ppDBText fields on a report after loading
in a default template.
Before doing the above I set the paperwidth to arbitrary value so it
will accommodate the maximum number of ppDBText fields the user can see
on this report ie.
ppReport.PrinterSetup.PaperWidth := 80;
This value will allow the maximum of ten ppDBText fields, however if for
example the user only select say three fields I need to set the
PaperWidth to a smaller value based on the spLeft + spWidth + Padding of
the third field, otherwise there will be a large blank area.
How can I convert the spLeft + spWidth + Padding into a new PaperWidth
value?
David.
I am dynamically creating ppDBText fields on a report after loading
in a default template.
Before doing the above I set the paperwidth to arbitrary value so it
will accommodate the maximum number of ppDBText fields the user can see
on this report ie.
ppReport.PrinterSetup.PaperWidth := 80;
This value will allow the maximum of ten ppDBText fields, however if for
example the user only select say three fields I need to set the
PaperWidth to a smaller value based on the spLeft + spWidth + Padding of
the third field, otherwise there will be a large blank area.
How can I convert the spLeft + spWidth + Padding into a new PaperWidth
value?
David.
This discussion has been closed.
Comments
The PrinterSetup.PaperWidth is defined in Report units. The you will
need to convert the value you are obtaining in screen pixels to these
units. Either manually (Screen.PixelsPerInch), or using the useful
conversion routines located in the ppUtils.pas file.
ppFromScreenPixels()
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com