Automatically print SSRS report?
Asked Answered
A

3

8

Is there a way to automatically print a SQL Server Reporting services (2005) report?

EDIT:

We needed to print a SSRS report at a network printer programmatically. Specifically, we wanted to fire this off from a stored procedure. We are currently using likeabanshee's method, and it is working. However, we would like something more managed, without the dependency on Adobe Acrobat and xp_cmdshell. We are looking into this method suggested by Paul G.

Amboceptor answered 26/1, 2009 at 17:58 Comment(1)
Can you elaborate on whether you're talking about printing it when the page loads in a browser, or if you just want it to show up on a printer at a specific time of day?Familial
C
6

You should be able to make that happen programmatically using the built-in web service to render the report. Some sample code for SSRS 2000 is here, but it should be pretty close to what you'd need for 2005 as well I think:

Charleycharlie answered 27/1, 2009 at 11:32 Comment(2)
That is exactly what I've been trying to find! ThanksUlises
Link no longer valid, and no clue what might have replaced it.Thermochemistry
R
2

If you use the Microsoft Business Intelligence Editor to create your SSRS, you can write code to fire off a print job.

Rachealrachel answered 26/1, 2009 at 18:26 Comment(0)
S
2

This question was posted by a co-worker for me. My comments and resolution follow:

Background: I essentially wanted to fire off SSRS reports to networked printers at our corporation through their UNCs. I have a real-time quality monitoring app (for an industrial manufacturing facility) running from SQL Server. As severe defects are detected I wanted to send a report to QA printers for them to analyze the defects. It also supplements our pager/email alerting system to stop problems as they are occuring.

Solution: I wrote a SQL stored procedure to monitor the quality failures. As they are detected, the stored procedure calls a .Net console app using xp_cmdshell, passing the product ID, UNC path, report name, Adobe Reader file path (on the SQL Server) and a few other parameters. Note the console app resides on the same server as the SQL Server. The console app accepts the paramters and passes them to SSRS with an output format of PDF. The PDF is created and saved locally, then the console apps runs a command line using Adobe Reader's hidden run mode (/t). The file path and UNC path are passed as parameters, and voila - automatic printing of SSRS files. An optional parameter tells the console app whether to delete the locally saved PDF.

Semitrailer answered 7/2, 2009 at 15:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.