How can I determine wether the Email-button or the print-button was pressed in the preview screen? I need to do some different processing based on the pressed button.
The TppPrintPreview class gives a number of pass thru properties to access each button in the preview toolbar. For instance, you can override the OnClick event of the email button to determine which button the user clicked.
Could you give an example of both buttons where the standard functionality of the buttons will remain in tact, but that I add the requested functionality to determine which button was pressed?
To take control of each button but leave the current functionality, your best bet would be to create a custom previewer. This would give you access to all the preview routines so you could use the RB code to do so. Otherwise, take a look at the TppPreview.Print and TppPreview.SendMail routines. This will show you what code is currently used when these buttons are pressed. You will find that these methods are very simple so re-coding them in your event handlers should not be an issue.
Comments
The TppPrintPreview class gives a number of pass thru properties to access
each button in the preview toolbar. For instance, you can override the
OnClick event of the email button to determine which button the user
clicked.
uses
ppPrvDlg;
TppPrintPreview(ppReport1.PreviewForm).EmailButton.OnClick :=
EmailButtonClickEvent;
or
TppPrintPreview(ppReport1.PreviewForm).PrintButton.OnClick :=
EmailButtonClickEvent;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Could you give an example of both buttons where the standard functionality
of the buttons will remain in tact, but that I add the requested functionality
to determine which button was pressed?
Regards,
Stef
To take control of each button but leave the current functionality, your
best bet would be to create a custom previewer. This would give you access
to all the preview routines so you could use the RB code to do so.
Otherwise, take a look at the TppPreview.Print and TppPreview.SendMail
routines. This will show you what code is currently used when these buttons
are pressed. You will find that these methods are very simple so re-coding
them in your event handlers should not be an issue.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com