Hi Grant,
Welcome to the MSDN newsgroup.
From your description, I understand you're developing a .NET framework 2.0
winform application which will access some server reports on a reporting
service report server. Currently you're wondering how to make your
application programmatically and silently print those server reports,
correct?
Based on my understanding, for your scenario, the difficulty is how to make
your report being printed without launching the printer/page settings
dialog. I've ever tried some possible approaches and here are the test
results:
1. Programmatically save the server-report as html file and load it into a
webbrowser control and use the webbrowser's "Print" method to print
it.(This is silent and will use the default printer setting).
Unfortunately, seem the html format report can not preserve all the styles.
So I don't think this will quite work.
2. Save the server report as PDF file, and add the Adobe Acrobat Reader
control in our winform, then we can print the document through the
AcroReader control's PrintXX method which will not launch print setting
dialog.
3. Save the report as TIFF format, then use some commandline tools to
convert the tif image to other image format which can be display in
browser. Then we can also use the webbrowser control to load and print it
silently.
option 2 may cause some problems since the acrobat reader control will
demand some certain permissions and it will still popup some permission
assertion dialog. To resolve such problem thoroughly, you can consider
purchase a 3rd party PDF printing component which can print PDF document
silently such as the one below:
http://www.acrobotics.net/v2/detailpage.asp?Prod_ID=43 As for programmatically load the server-report, you can use the SQL Server
reporting service 2005's webservice interfaces:
#ReportExecutionService Class
http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswe bservice.rsexecutionservice2005.reportexecutionservice.aspx
#Rendering and Execution Methods
http://msdn2.microsoft.com/en-us/library/ms152952.aspx In addition, here are some article describing how to programmatically set
system default printer or the default pagesetting of IE/webbrowser:
#WMI set default printer
http://cheeso.members.winisp.net/srcview.aspx?file=printer.cs
#How To Change Print Settings for Internet Explorer and the WebBrowser
Control Programmatically in Managed C++
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q317840 Hope this helps. If you have any further questions or any other
consideration on this, please feel free to post here.
Regards,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may
learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no
rights.)