Change Margins at runtime
I'm using RB7(Ent) on Delphi 5.
I have the report files saved in RTM. I'm trying to change the margins at
runtime by assigning the following code
procedure TForm1.btnDesignClick(Sender: TObject);
begin
ppReport1.Engine.Page.PrinterSetup.MarginTop := Single(Edit1.Text);
ppReport1.Engine.Page.PrinterSetup.MarginLeft := Single(Edit2.Text);
ppReport1.Engine.Page.PrinterSetup.MarginBottom := Single(Edit3.Text);
ppReport1.Engine.Page.PrinterSetup.MarginRight := Single(Edit4.Text);}
ppDesigner1.Show;
end;
but when i go to Page Setup & point to Margins tabpage it seems the margins
are always the same which 0.25
How should i overcome this?
I have the report files saved in RTM. I'm trying to change the margins at
runtime by assigning the following code
procedure TForm1.btnDesignClick(Sender: TObject);
begin
ppReport1.Engine.Page.PrinterSetup.MarginTop := Single(Edit1.Text);
ppReport1.Engine.Page.PrinterSetup.MarginLeft := Single(Edit2.Text);
ppReport1.Engine.Page.PrinterSetup.MarginBottom := Single(Edit3.Text);
ppReport1.Engine.Page.PrinterSetup.MarginRight := Single(Edit4.Text);}
ppDesigner1.Show;
end;
but when i go to Page Setup & point to Margins tabpage it seems the margins
are always the same which 0.25
How should i overcome this?
This discussion has been closed.
Comments
loading a report template, use the Report.Template.OnLoadEnd event in order
to set the Report.PrinterSetup.
Use the Report.Engine.Page.PrinterSetup when you want to change each page
after the report has generated it, but before it has sent it to the devices.
You'll want to use the Report.OnEndPage event to set the engine's page
object in other certain scenarios.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com