AR11 - changing default printer

Posted by: darin on 27 April 2020, 6:16 am EST

  • Posted 27 April 2020, 6:16 am EST

    When we “print” documents and save as RDF, or PDF, or print to screen, AR takes the parameters of the default printer to get the paper size.

    That works great.

    Except

    When the user’s default printer is a label printer and they are printing a “normal” report. Is there a way to change the default printer to be the built-in windows XPS printer so it is an 8 1/2x11 piece of paper.

    We want the “default” changed only for the duration of this one report.

    Thanks.

  • Posted 27 April 2020, 2:59 pm EST

    Hello,

    Please set the Printer name for the specific report document as follow:

    ```

    rpt.Document.Printer.PrinterName = “Your Printer Name”;

    Thanks,
    Mohit
  • Posted 28 April 2020, 1:02 am EST - Updated 30 September 2022, 8:14 am EST

    This command does not seem to honor the PrinterName setting.

    rpt.Document.Save(file_name, GrapeCity.ActiveReports.Document.Section.RdfFormat.ARNet, GrapeCity.ActiveReports.Document.Section.SaveOptions.Compressed)

    Before that command is issued, i issued:

    rpt.Document.Printer.PrinterName = “Microsoft XPS Document Writer”

    But, the images that are saved are still in the size restrictions of the label printer i have setup as my default.

    The code first sets the Printer.PrinterName and then executes the Save command.

    The files i attached:

    Image XPS default the save command was done when my default printer is the XPS printer.

    Image Label default the save command was done when my default printer is the label printer.

    Both of these were created with the printername being changed to the XPS driver and then the save done.

    You can see from the images, the printername is not being honored on the save command.

    Images.zip

  • Posted 28 April 2020, 6:50 pm EST

    Hello,

    Could you please set the PrinterName before calling the Run method of the Report. Also, please share the result when you tried to directly load the report into the viewer without saving into rdf format.

    Thanks,

    Mohit

  • Posted 28 April 2020, 11:24 pm EST

    ok.

    that seemed to work.

    let me do lots of testing.

    thanks.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels