Print report without preview
-
Thursday, March 04, 2010 5:30 AMThe reports are in server mode .rdl format and are rendered via Web report viewer. The user needs to be able to print to default printer without preview and print dialog box prompted. Is this possible?
All Replies
-
Friday, March 05, 2010 9:49 AMModerator
Hi awu255,
By default, SQL Server Reporting Services uses RSClientPrint to print report. The RSClientPrint is an ActiveX control and is not abled to progrmmed.
To print a report without previewing, I would suggest you implementing custom application to do so:
1. Use the “Render” method from SQL Server Reporting Service web service to render the report to an EMF file.
2. Use the PrintDocument .NET object to print the image file using a specified printer in specified size.By the way, if you have installed SQL Server Reporting Services product sample, you will find a print sample at the following location by default. We can use the sample code in our custom application:
C:\Program Files\Microsoft SQL Server\100\Samples\Reporting Services\Extension Samples\PrinterDelivery Sample
For more information, please see:
PrintDocument Class: http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx
Please feel free to ask, if you have any more questions.
Thanks,
Jin Chen
Jin Chen - MSFT -
Sunday, March 07, 2010 12:39 AMThank you. This was really helpful. I almost get it to work. I can now print when I set the website anonymous user identity to Administrator but if I switch it back to IUSR then it doesn't print. No error, just nothing comes out of my printer.
Where do I need to set permission for IUSR to print? -
Wednesday, March 10, 2010 7:00 AMModeratorHi awu255,
Since Anonymous user does not have permssions to render a report, the printing will fail.
To solve the issue, we need to add the IUSR to report server using Report Manager.
For more information, please see:
http://msdn.microsoft.com/en-us/library/ms156014(SQL.90).aspx
Thanks,
Jin Chen
Jin Chen - MSFT -
Thursday, March 11, 2010 2:14 AMI have given IUsr administrator right and still can't print. I have also created a windows user, make the user server administrator, report administrator and still I can't print.
I have a user that I created since the server was built, that belongs to server administrators group and user that user, I can print. Any ideas? -
Tuesday, June 01, 2010 4:25 PM
Jin Chen,
I'm also looking for a way to print without going into print preview using server side reports (using rdl reports and not rdlc). I have VS 2008 sp1 and sql server 2008; and VS 2010 and sql server 2008 R2 installed, but no directory located at:
C:\Program Files\Microsoft SQL Server\100\Samples\Reporting Services\Extension Samples\
only:C:\Program Files\Microsoft SQL Server\100\Samples\Reporting Services\Model Samples
and
C:\Program Files\Microsoft SQL Server\100\Samples\Reporting Services\Report Samplesand neither of these contains the sample you are referring to. Can you please advise me on this as this issue is a show-stopper for our project if we don’t resolve it.
Thanks.
-
Sunday, August 05, 2012 4:21 PMHi and for Crystal Report in VS 2008 C# Follow this link..http://codingresolved.com/discussion/18/print-report-without-preview-/p1

