Change paper-size.
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
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
This discussion has been closed.
Comments
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.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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.
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.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com