How to PrintWithWpf on a network printer?
Posted: Mon Jan 07, 2013 4:20 pm
Hi,
when passing an UNC-printername as parameter to Report.PrintWithWpf(printername) printing fails with an PrintQueueException saying the printername is invalid.
Looking at the PrinterName property (inside the PrintQueueException) it seems that the hostname is missing (\\192.168.2.1\HPLJ1320tn becomes just HPLJ1320tn).
I tried different network printers just to make sure there's no typo. Using Report.Print(printernmame) works but it screws up the layout of the report based on the system's DPI-setting.
Next thing I tried was setting the printername through Report.PrinterSettings.PrinterName before calling PrintWithWpf. That results in printing on the system's default printer - no matter what printername was set.
Next thing I tried was passing a PrintTicket as paramter to PrintWithWpf but no matter what printer the PrintTicket belongs to, it behaves like no printer was supplied at all and just prints on the system's default printer.
It seems that the only way to specify a printer is passing its name as a parameter to PrintWithWpf, but it does not work with network printers.
I'm running out of ideas, so any help would be appreciated.
Version: Stimulsoft.Report.Wpf 2010.2.800.0 (upgrade is not an option)
Best Regards
Steffen
when passing an UNC-printername as parameter to Report.PrintWithWpf(printername) printing fails with an PrintQueueException saying the printername is invalid.
Looking at the PrinterName property (inside the PrintQueueException) it seems that the hostname is missing (\\192.168.2.1\HPLJ1320tn becomes just HPLJ1320tn).
I tried different network printers just to make sure there's no typo. Using Report.Print(printernmame) works but it screws up the layout of the report based on the system's DPI-setting.
Next thing I tried was setting the printername through Report.PrinterSettings.PrinterName before calling PrintWithWpf. That results in printing on the system's default printer - no matter what printername was set.
Next thing I tried was passing a PrintTicket as paramter to PrintWithWpf but no matter what printer the PrintTicket belongs to, it behaves like no printer was supplied at all and just prints on the system's default printer.
It seems that the only way to specify a printer is passing its name as a parameter to PrintWithWpf, but it does not work with network printers.
I'm running out of ideas, so any help would be appreciated.
Version: Stimulsoft.Report.Wpf 2010.2.800.0 (upgrade is not an option)
Best Regards
Steffen