Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

PrinterName Not Getting Set at Runtime

edited November 2008 in General
Hi All,

ReportBuilder for Delphi 2007 Professional Edition, Version 10.06

I'm trying to set the report's printer name at runtime, but it's not getting
set.

code:
ppReport.DeviceType := 'Printer';
ppReport.PrinterSetup.PrinterName := 'Accounting HP LaserJet 4250';
ppReport.Print;

The .PrinterName is = 'Default', after I try to set the name.

I've tried this on two different reports, same results.

Any ideas?

TIA--patrick dohogne

Comments

  • edited November 2008
    Hi Patrick,

    Do not set the PrinterName property directly. Try using the PrinterNames
    list instead so you can be sure the correct name is being used.

    ppReport.PrinterSetup.PrinterName := ppReport.PrinterSetup.PrinterNames[1];

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2008
    Thank you Nico,

    Your suggestion led me to my real issue - I left off the last two characters
    of the printer name, when trying to assign it.

    --patrick

This discussion has been closed.