Re: Default Printer per template using scripts

Hi, I have three printers on my system, each with a different paper size and type.

I want to define a default printer for every report template in my app settings. How can I do that using scripts? I have already created a setting system using ini read and write, and I want to define the printer for each template in that ini file.

Many Thanks

Re: Default Printer per template using scripts

any Idea?

Re: Default Printer per template using scripts

In theory, the printer selection should look like this:

Form1.frxReport.PrintOptions.Printer := 'PrinterName';
Form1.frxReport.PrintOptions.Copies := 1;
Form1.frxReport.PrepareReport;
Form1.frxReport.Print;
Визуальное программирование: блог и телеграм-канал.

4 (edited by sparrow 2023-03-13 09:41:17)

Re: Default Printer per template using scripts

Hi,

You can also select a printer in the settings for each of your reports.
Here you can also specify other options for printing.

Post's attachments

Attachment icon fstrep.jpg 49.76 kb, 56 downloads since 2023-03-13 

Re: Default Printer per template using scripts

Many Many thanks.

Re: Default Printer per template using scripts

k245 wrote:

In theory, the printer selection should look like this:

Form1.frxReport.PrintOptions.Printer := 'PrinterName';
Form1.frxReport.PrintOptions.Copies := 1;
Form1.frxReport.PrepareReport;
Form1.frxReport.Print;

Unfortunately, this code will not work, since the TfrxReport.Print method is not supported in MVDB. And this is very sad. If anyone knows how to programmatically send a report to print, bypassing the preview window, please let me know.

Визуальное программирование: блог и телеграм-канал.