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

Bypass printer setup dialog

edited June 2001 in General
I'm running a series of reports from the same Delphi form using a
TCheckListBox. In some instances, I am using the same TppReport. In other
instances I use a different TppReport residing on the same form.

I would like require the user to select the printer only once and have the
application bypass the Select Printer dialog when subsequent reports are
loaded. I tried using PrinterSetup.PrinterName = 'Current', but the dialog
still popped up.

Is there some way to suppress the dialog?

Thanks,

Les

Comments

  • edited June 2001
    If you load a template into a report object, you will want to make sure to
    set the PrinterSetup property after the template has loaded. See the tech
    tips newsgroup in the templates thread for information on using report
    templates.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2001
    Jim-

    Thanks for the reply. I'm not using templates, which brings up another
    point. Since I need to write code for a number of RB component events, I
    figured I wouldn't be able to use templates since the code would refer to
    components that didn't exist at compilation. Am I incorrect in my
    assumptions?

    As to your reply, does setting the PrinterSetup property somehow supress the
    Printer Setup dialog from popping up when the report starts to print?

    Thanks again,

    Les

  • edited June 2001
    You assumption is correct. Use RAP if you are going to use templates and
    event handlers.

    You should be able to set the Report.ShowPrintDialog to False once the first
    report has been printed, and the printer known. Use the Report.BeforePrint
    event to set ShowPrintDialog to false.

    The printer setup is saved as part of the template definition. My point was
    that if you are trying to set the printer setup, make sure it happens after
    a template has loaded. If you set the report printer setup, then load the
    template, then the template will assign its printer setup to the report, and
    effectively erase any changes you made. I just wanted to be sure you
    weren't erasing your printersetup modifications without knowing it.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2001
    Hi Les,

    set 'ShowPrintDialog' of TppReport to False.

    regards,
    Chris Ueberall;

    dialog
This discussion has been closed.