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

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.