Saturday 15 January 2011

c# - Printing a document over application --> WCF Service. Can I access local printers? -


I have an application running in which the WCF backend is running.
Everything is doing a great job, except one thing, printing documents!

Actually I have a local report ( Microsoft.Reporting.WinForms.LocalReport , .rdlc file) that resides on the server, and a command Receives the app to print from the client.
The server populates the report and prints it on the printers specified by the client

This network works to print on the printer, but I want to be able to print it from the local printer (Especially 'Microsoft XPS Document Writer', when I try, it can be understood).

Local Report contains a population of content from a database, which is why it is done from the server.
It is also used by other applications, so I want to keep it on server instead of local copy



I have tried to return the service PrintDocument instead, but it does not sort the WCF properly.
My second idea was to convert PrintDocument (or example of LocalReport , or even export) it's a PDF ) In the Byte array , sends it to the customer, then it's a back of a hack to convert it back and handling the printing.

But as I am new to the WCF world, I wanted to hear if there is a better way.
Am I going about all the things?

Microsoft Institution. Reporting. Winform Customer Reports in the Local Report (WinForms, I believe you are using). You can add

  var report = new Microsoft.Reporting.WinForms.LocalReport (); Report. data source. Add (New ReportDataSource ("MyReport", GetReportData ()));   

GetReportData can call WCF and bring it into the list of items which can be provided in the form of a report. If you do this, the report will be prepared on behalf of the customer and the local printer will be available to all. In fact, this is also the standard way of reporting.

No comments:

Post a Comment