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

How to print without showing a preview.

edited November 2001 in General
I was wondering if anyone ever printed a report without showing any preview.

Here is what I would like to do:

Show the ChoosePrinter Dialog box, and then print a couple of template
reports in the background.

I thought that the code would look like something like what follows but the
PrintDialog property is at nil and is read only!!! Also, the Print procedure
shows a preview.
mRepDataModule.ppReport.Template.FileName := AReportFileNameString;
mRepDataModule.ppReport.Template.LoadFromFile;
mRepDataModule.ppReport.PrintDialog.ShowModal;
mRepDataModule.ppReport.Print;

Thanks in advance!!!

Yann

Comments

  • edited November 2001
    Hi Yann,

    preview.

    Yes, it is possible, but it depends on the device you choosed for printing.
    Set the property 'DeviceType' to 'Printer' for instance.

    regards,
    Chris Ueberall;

    the
    procedure
  • edited November 2001
    >Yes, it is possible, but it depends on the device you choosed for printing.

    Thanks Chris for your response!!! The following code works:

    mRepDataModule.ppReport.Template.FileName := AReportFileNameString;
    mRepDataModule.ppReport.Template.LoadFromFile;
    // The following is to not show any preview.
    mRepDataModule.ppReport.DeviceType := 'Printer';
    // The following is to not show or not the dialog box.
    mRepDataModule.ppReport.ShowPrintDialog := ShowPrintDialogBool;
    mRepDataModule.ppReport.Print;

    Yann
This discussion has been closed.