Position and size of a print preview
I can set zoom and window state for print preview window like this:
procedure TMainForm.ppReport1PreviewFormCreate(Sender: TObject);
begin
ppReport1.PreviewFormSettings.ZoomSetting := zsPercentage;
ppReport1.PreviewFormSettings.ZoomPercentage := 100;
ppReport1.PreviewFormSettings.WindowState := wsMaximized;
end;
How can I set position and a size?
There is ppReport1.PreviewForm.Top/Height/Width properties, but it
looks like they are read only. If I set it in
ppReport1PreviewFormCreate it does not have any effect.
Thanks
Zoran
procedure TMainForm.ppReport1PreviewFormCreate(Sender: TObject);
begin
ppReport1.PreviewFormSettings.ZoomSetting := zsPercentage;
ppReport1.PreviewFormSettings.ZoomPercentage := 100;
ppReport1.PreviewFormSettings.WindowState := wsMaximized;
end;
How can I set position and a size?
There is ppReport1.PreviewForm.Top/Height/Width properties, but it
looks like they are read only. If I set it in
ppReport1PreviewFormCreate it does not have any effect.
Thanks
Zoran
This discussion has been closed.
Comments
TppCustomReport(Sender).PreviewForm.Viewer
That is the actual TForm object you are seeing. Set the properties in there.
HTH,
Ed Dressel
Team DM
anything. Print preview form still pops up in the middle of the screen and
in default size.
RB 10.02, BDS 2006
TppCustomReport(Sender).PreviewForm.Viewer.OnShow
to an method and assign the values there.
HTH,
Ed Dressel
Team DM
Thanks Ed.
On Sat, 28 Oct 2006 19:58:41 -0700, "Ed Dressel [Team DM]"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TrptHHIndVisList.ppRptHHIndVisListPreviewFormCreate(
Sender: TObject);
begin
with TppReport(Sender).PreviewForm do begin
position := poDesigned;
windowstate := wsNormal;
Height := 900;
width := 900;
Top := 100;
left := 200;
end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It seems to work for me...
JonD
Hi Jon
I did this before, but without "position := poDesigned" and it didn't
work. Now with it -- it works fine! Probably default was "position :=
poScreenCenter" and it was overwriting my settings for
Top/Left/Width/Height.
Thanks.
On Sun, 29 Oct 2006 11:24:53 -0500, Jon Lloyd Duerdoth
JonD