SQL Reporting Services: Printing without displaying a report

I am working with SQL Reporting Services within a Windows Forms .NET application. Is there a way that I can print a report without displaying it first and without displaying a print dialog first? I just want to send the report to the default printer without the user doing anything other than clicking a button in my application. I actually have a set of several reports that needs to be printed when this button is clicked and I'd like to avoid forcing the user to view and print each of them separately. Thanks.
Paracom_IncAsked:
Who is Participating?
 
simon_kirkConnect With a Mentor Commented:
The ReportViewer control in VS2005 I think has the the ability to do this.  Try this example code: http://gotreportviewer.com/EMFPrint.zip 
0
 
simon_kirkCommented:
Hi.
Are you using the 2000 or 2005 version of RS?
0
 
Paracom_IncAuthor Commented:
I am using the 2005 version.
0
 
Paracom_IncAuthor Commented:
OK. The sample code works, but it includes the creation of a DataTable to use as the DataSource for the report. My report already works with the ReportViewer control for showing the report. I would like to be able to use the existing DataSource and DataSet defined in the report so that I don't create a maintenance issue by having this code in two places. If I don't add a populated table to the report's DataSources collection I get an error: A data source instance has not been supplied for the data source \"dsMain\". dsMain is the name of the DataSource defined in the report. Is there a way that I can cause this dataset to be populated for the report just like it is when the ReportViewer control displays the report?
0
All Courses

From novice to tech pro — start learning today.