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

Change paper-size.

edited February 2004 in General
I design a report using the paper size A4.
However, I need through programming, to alter the paper size for "Letter."
I used:

"with Report.PrinterSetup of the"
begin
PaperName := 'Letter';
MarginTop := 5;
MarginBottom := 5;
end;

However, when I print the report, the page size (Letter) you is not
respected, and the baseboard moves forward for next page. What do I need to
do to change the paper in run-time and this paper to be respected?

* Delphi 7.

Thanks,
[]s,
Alessandro Ferreira

Comments

  • edited February 2004
    Hi Alessandro,

    Where are you setting the properties below? What type of report is this?
    Are you printing to archive? From archive? Are you able to recreate this
    behavior using a minimal report with no event hanlders and no report
    objects? I need more information about how your report is set up to see
    exactly what is happening here.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2004
    Dear Nico,

    In the component ppReport, I configured the paper = A4. For the time being,
    this report is simple, header, detail and footer;
    However, in the moment of calling the report, I verify which the type of the
    connected printer and in case the printer is matrix, I need to alter the
    type of the paper for Letter.
    You follows part of my code below:

    if IsMatrix then
    begin
    Report.PrinterSetup.PaperName := 'Letter';
    Report.PrinterSetup.MarginTop := 0;
    Report.PrinterSetup.MarginBottom := 2;
    end
    else
    begin
    Report.PrinterSetup.PaperName := 'A4';
    Report.PrinterSetup.MarginTop := 2;
    Report.PrinterSetup.MarginBottom := 15;
    end;
    Report.Print;

    The one that I need, is to alter the page configurations in run-team, for
    when the printer goes matrix, to use paper = 'Letter' and when the printer
    goes Laser/DeskJet, to use paper = 'A4.' After me to alter the size of the
    paper, would you be necessary to call some method to update the ppReport?

    Thank you for the attention,
    []s,
    Alessandro Ferreira.



  • edited February 2004
    Alessandro,

    Are you sure the proper code is being called when the printer is a dot
    matrix printer? If you need to change these settings at run time, you can
    use the Report.BeforePrint event. In my testing, changing the paper size
    from A4 to Letter before calling Report.Print seemed to work correctly.

    --
    Best Regards,

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