Reading report.PrintOptions.Copies

edited 5:56PM in FastReport VCL
Hi,

i have to print several reports in Delphi after each other (as i must archive them as separate files). For the first print the print dialogue is shown. All subsequent reports do not show the print dialogue and are sent to the same printer.

Here comes my problem:

The number of copies must be set equal on all reports. Thus if the user selected two copies all reports should be printed twice.

I can set the default number of copies by report.PrintOptions.Copies := NumberOfCopies.

But how can i read the number of copies the user selected in the print dialogue of FastReports? I tried this after the report.print: NumberOfCopies := report.PrintOptions.Copies;

This does not work as the value remains at the initial default value.

How must i do this?

Comments

  • edited 5:56PM
    user2019 wrote: »
    Hi,

    i have to print several reports in Delphi after each other (as i must archive them as separate files). For the first print the print dialogue is shown. All subsequent reports do not show the print dialogue and are sent to the same printer.

    Here comes my problem:

    The number of copies must be set equal on all reports. Thus if the user selected two copies all reports should be printed twice.

    I can set the default number of copies by report.PrintOptions.Copies := NumberOfCopies.

    But how can i read the number of copies the user selected in the print dialogue of FastReports? I tried this after the report.print: NumberOfCopies := report.PrintOptions.Copies;

    This does not work as the value remains at the initial default value.

    How must i do this?

    I am not sure if the OnReportPrint event would be able to capture that info from the system print dialog. But, in your Delphi code, you could call a TPrintDialog ahead of your first report, where the user would select the printer and number of copies, and then call all the reports to print directly, without displaying a FR print dialog, but updating each report's PrintOptions.Copies

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.