Disable print button
Hi! Does anybody know, if it is possible to disable printing? So user
could only see the report.
Best,
Mart
--- posted by geoForum on http://delphi.newswhat.com
could only see the report.
Best,
Mart
--- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.
Comments
You can easily set the visibility of the print button in the previewer using
the PrintButton property of the Report.PreviewForm property.
uses
ppPrvDlg;
procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppPrintPreview(ppReport1.PreviewForm).PrintButton.Visible := False;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Are you using the default preview plugin? If not, you can easily alter the
plugin code to hide or change any aspect of the preview window you want.
The code I sent was meant to be used in the OnPreviewFormCreate event which
fires after Report.Print is called and with the default previewer. In my
testing with the default RB components, it worked as expected.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Unfortunately it doesn't work - on that stage is FPreview nil, so I get
access violation on row 299 (file ppPrvDlg.pas):
function TppPrintPreview.GetPreview: TppPreview;
begin
if UsingDefaultPreviewPlugIn then
Result := TppPreview(FPreview)
else
Result := nil;
end;
FPreview is created in the TppPrintPreview.FormCreate, but FormCreate is
called only when I do ppReport1.Print.
--- posted by geoForum on http://delphi.newswhat.com
Thanks again.
--- posted by geoForum on http://delphi.newswhat.com