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

Know if printed to printer

edited September 2008 in Devices
Is it possible to know when something has actually been printed? When
using a TppReport it's OK, I can use the OnPrintingComplete event, but I'm
using a TppArchiveReader which doesn't have one. I'm also using a bespoke
TppPrintPreview, so I'm using the Archive Reader to print to screen, then
using the preview screen to print to the actual printer (showing the print
dialog) or exporting to other formats like PDF.

What I want to do is to know that either an export has been created or
it's been sent to a printer, IOW the user didn't click print but cancel on
the print dialog.

Any help appreciated.

--
Jeremy Knowles

Comments

  • edited September 2008
    Hi Jeremy,

    Take a look at the following article. You can use the OnPrintDialogClose
    event of the ArchiveReader to determine whether the user printed or selected
    to cancel.

    ------------------------------------------
    Tech Tip: Detecting whether PrintDialog's
    Cancel button was Selected
    ------------------------------------------

    When the print dialog is displayed to the user, you can determine whether
    the Cancel button was selected by using the Report.OnPrintDialogClose event.

    Example:

    procedure TForm1.ppReport1PrintDialogClose(Sender: TObject);
    begin

    if ppReport1.PrintDialog.ModalResult = mrCancel then
    ShowMessage('Use chose to cancel the print request');

    end;


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    "Jeremy Knowles"
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2008
    Nico Cizik (Digital Metaphors) wrote:


    Perfect, thanks Nico. I even looked through the tips and missed this.

    Thanks for the help,

    --
    Jeremy Knowles
This discussion has been closed.