Hi,
Is it possible to print a report by code?
Best regards,
Ingo
Hi Ingo,
Here is link on how to print reports (programmatically) on SL, WPF and Winforms, hopefully one of these will work for you.
Regards,
Miguel
Hi Miguel,
Calling PrintWithDialog throws an exception -> The operation requires a viewer with a report that has finished loading.
Thus I have to open the viewer prior to print it? Can I avoid this?
Hello ingos,
This is just a follow up on the thread if you have any further questions in regards to printing a report programatically and if I can be of any further assistance with this thread.
Let me know if you have any questions with this matter. Thank you.
By the way (I just reviewed my response), by "wait" for the report to be rendered, I meant handling the ProcessingCompleted Event.
Miguel.
Reports need to be rendered before being able to print or export using the viewer's API, so you should wait for the report to be rendered (using a hidden viewer maybe) and print it once it's ready. However, there is an alternative if you are looking for something more simliar to a batch process which is using the Report Exporter. This will allow you to export reports to a specific format without any viewer and just print them as you would normally do with any file.
Here is a previous thread discussing the last option which includes useful information/links to do it that way.
I hope one of these alternatives work for you.