How to print without showing a preview.
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
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
This discussion has been closed.
Comments
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
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