This question was sent by an employee for me. My comments and permission:
Background: I essentially wanted to hide SSRS reports to network printers in our corporation through their UNC. I have a real-time quality monitoring application (for an industrial production facility) powered by SQL Server. When serious defects were discovered, I wanted to send a report to QA printers for defect analysis. It also complements our pager / email alert system to stop problems as they arise.
Solution: I wrote a SQL stored procedure to control quality failures. When they are found, the stored procedure calls the .Net console application using xp_cmdshell, passing the product identifier, UNC path, report name, path to the Adobe Reader file (on SQL Server), and several other parameters. Please note: the console application is located on the same server as SQL Server. The console application accepts the parameters and transfers them to SSRS with the output PDF format. A PDF is created and saved locally, then console applications launch the command line using the Adobe Reader hidden mode (/ t). The file path and UNC path are passed as parameters, and voila is used to automatically print SSRS files. An optional parameter tells the console application whether to delete the locally saved PDF.
ScottLenart
source share