Reset printer to system default after user change

Hi,
We,ve migrated from QuickReport to FastReport, and encountered the following behavior.
When a user changes the printer on the dialog that appears after clicking the "Print" button on the preview form, it seams that the selected printer is remembered across all reports.

Executing [reportName]->Print() prints on earlier selected printer.
The desired behavior is that the Printer selected on the preview is valid only for printing from the current preview, and returns to default system printer after printing the report..

How can I archive this?

I've tried setting this in the report constructor:
report->PrintOptions->Printer = "Default";

with no luck.

Please help.

Comments

  • edited 8:57AM
    reply from fastreport ticket system:
    zikbro wrote: »
    Use

    var
    prnName: array[0..255] of Char;
    begin
    GetProfileString('windows', 'device', '', prnName, 255);
    frxReport1.PrepareReport();
    frxReport1.PrintOptions.Printer := 'PDF24 PDF';
    frxReport1.Print;
    frxReport1.PrintOptions.Printer := Copy(prnName, 1, Pos(',', prnName) - 1);
    frxReport1.SelectPrinter;
    frxReport1.Print;
    end;

    so you have to get the default printer name, assign it and invoke method "SelectPrinter"
    zikbro wrote: »
    Hi,
    We,ve migrated from QuickReport to FastReport, and encountered the following behavior.
    When a user changes the printer on the dialog that appears after clicking the "Print" button on the preview form, it seams that the selected printer is remembered across all reports.

    Executing [reportName]->Print() prints on earlier selected printer.
    The desired behavior is that the Printer selected on the preview is valid only for printing from the current preview, and returns to default system printer after printing the report..

    How can I archive this?

    I've tried setting this in the report constructor:
    report->PrintOptions->Printer = "Default";
    

    with no luck.

    Please help.

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.