Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Calculating PaperWidth

edited January 2013 in General
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.

Comments

  • edited January 2013
    Hi David,

    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()

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.