How to PrintWithWpf on a network printer?

Stimulsoft Reports.WPF discussion
Post Reply
stehwn
Posts: 22
Joined: Wed Jul 08, 2009 8:20 am

How to PrintWithWpf on a network printer?

Post by stehwn »

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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to PrintWithWpf on a network printer?

Post by HighAley »

Hello.

I met the same problem before. When we used UNC printer name than there was a delay more than a minute. When we used in the UNC printer name its' local name on the server the printing began almost immediately. We found the same problem here (http://social.msdn.microsoft.com/Forums ... 19cf1e5f61) but it isn't solved. If you could find the reason, we'll fix this problem.

Also there could be a problem in network security. It's possible that application have no access to the settings of the network printer.

Please, try to use local printer name.

Thank you.
stehwn
Posts: 22
Joined: Wed Jul 08, 2009 8:20 am

Re: How to PrintWithWpf on a network printer?

Post by stehwn »

Hello,
the problem is not slow UNC-printing but no UNC-printing at all when showPrintDialog == false in version 2010.2.800.
Using the server's local printername also results in PrintQueueException saying the printername is invalid.
Same network printers work with newer version 2012.3.1500.0. Since the printerNames are 100% correct I assume the printqueue is created on the wrong printserver.
If I do not provide any printername the system's default printer is used. At the moment setting network printers as default printer before printing without providing any printername seems to be the only solution. But I don't want to do something ugly like that.


Best Regards
Steffen
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to PrintWithWpf on a network printer?

Post by HighAley »

Hello.

There were some changes in source code. If you bought our source code, we could send you these changes in source code.

Thank you.
stehwn
Posts: 22
Joined: Wed Jul 08, 2009 8:20 am

Re: How to PrintWithWpf on a network printer?

Post by stehwn »

Hello,

if we had bought the source code I would have just debugged and fixed this issue instead of asking for help in this forum.
Network-printing is not some nice-to-have-feature of a report-tool - it's an essential core-feature!
My boss has to buy the source code just to make a broken core-feature work? Really? My boss is not happy.
If the only solution to fix this main issue is to give me the source code - please do so.

Best Regards
Steffen
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Re: How to PrintWithWpf on a network printer?

Post by Andrew »

Hello,

I am sorry if our last reply might cause some inconvenience and misunderstanding from your side. We did not mean that you need to buy the source code to make the fix, but meant, if you already have the source code (purchased Reports.Wpf with source code some day ago), then we could fix the problem and send you corrected source code.

We will fix the issue ourselves. For getting a patch, please send your request to support@stimulsoft.com referring to this forum thread. Also, in the request to support, please send user information which identifies you as a licensee of Reports.Wpf.

Sorry again.
Thank you.
stehwn
Posts: 22
Joined: Wed Jul 08, 2009 8:20 am

Re: How to PrintWithWpf on a network printer?

Post by stehwn »

Hello,

this is great news!
Sorry for misunderstanding.
I'll send an e-mail after lunch.

Best Regards
Steffen
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to PrintWithWpf on a network printer?

Post by HighAley »

Hello.

We have already sent you a fixed assembly.

Thank you.
Post Reply