Setting Printer in script in Report OnReportPrint

I'm trying to force one of the reports to always print to a specific printer regardless of what printer is set.

I have tried this on the Report OnPrintReport event, but it is still printing to the printer set in the properties.


What am I doing wrong or how can this be done in the scripting? If I run it in debug, it steps into the code, but just jumps out when assigning the printer.


procedure frxReport1OnReportPrint_inherited(Sender: TfrxComponent);

var

 PrinterName : string;

begin

 PrinterName := 'Canon MF210';

 Report.PrintOptions.Printer := PrinterName ;

end;

Comments

Leave a Comment