I'm a bit unclear about what you would like to accomplish. Are you looking to print a selection of text from the preview? If so, note that the preview window does not have this type of user interaction available (highlighting text). One option might be to export the desired text to a text file and print that behind the scenes.
You can use the TppPrintPreview.PrintButton property to access the print button of the preview window. Something like following from the OnPreviewFormCreate event...
with RelBasic do begin (..) RepBasic.BeforePrint := OnBeforePrint; TppPrintPreview(RepBasic.PreviewForm).PrintButton.Visible := False; RepBasic.Print; end;
But, error appears, AccessViolation on TppPrintPreview.GetPreview.
Comments
I'm a bit unclear about what you would like to accomplish. Are you looking
to print a selection of text from the preview? If so, note that the preview
window does not have this type of user interaction available (highlighting
text). One option might be to export the desired text to a text file and
print that behind the scenes.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I want to disable print in Preview mode... I would like my users only view
report, doen't print it.
Regards,
Fellipe H.
Thanks for the clarification.
You can use the TppPrintPreview.PrintButton property to access the print
button of the preview window. Something like following from the
OnPreviewFormCreate event...
uses
ppPrvDlg;
...
TppPrintPreview(ppReport1.PreviewForm).PrintButton.Visible := False;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
But.. I put these code, and I add the uses unit:
with RelBasic do
begin
(..)
RepBasic.BeforePrint := OnBeforePrint;
TppPrintPreview(RepBasic.PreviewForm).PrintButton.Visible := False;
RepBasic.Print;
end;
But, error appears, AccessViolation on TppPrintPreview.GetPreview.
I do something wrong?
Thanks
Fellipe H.
Fellipe H.