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

Print preview full screen - my _no-code_ solution

edited August 2001 in General
I made a ppReport descendant that publishes a MaximizePreviewWindow
property. So, I just set it to true at design time and my preview windows
are maximized. Here is the class code:


TAprReport = class(TppReport)
private
FMaximizePreview: Boolean;
protected
procedure DoOnPreviewFormCreate; override;
public
constructor Create(aOwner: TComponent); override;
published
property MaximizePreviewWindow: Boolean read FMaximizePreview write
FMaximizePreview default True;
end;


{ TAprReport }

constructor TAprReport.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
AllowPrintToFile:=True;
FMaximizePreview:=True;
end;

procedure TAprReport.DoOnPreviewFormCreate;
begin
if FMaximizePreview then begin
PreviewForm.WindowState := wsMaximized;
TppViewer(PreviewForm.Viewer).ZoomSetting := zs100Percent;
end;
end;
This discussion has been closed.