I am not sure what is the proper term for the functionality that allows to print a document with no user interaction. In this post I am using "no-touch printing" term. For instance: Every morning Jon Smith turns on his computer at the office and runs his favorite internet browser. The browser opens the start page which is the company web-site. The start page of the company web-site indicates that Jon Smith has logged in and prints the daily schedule on the default printer that is set up on Jon's computer. Let's see how we can implement such scenario using ActiveReports6.
ActiveX Viewer And Flash Viewer.
ActiveX Viewer was introduced in the COM version of the product. ActiveReports was growing up, .NET framework became the product environment, but ActiveX Viewer never was dead in the water, and with good reason! ActiveX Viewer provides developer with the rich capabilities of displaying and printing the reports on the web. For example it's pretty easy to implement no-touch printing on the web with ActiveX Viewer. The code should load the report in the viewer, then wait until the loading is finished and then call PrintReport method. The knowledge base of ActiveReports has several articles that show the sample of such code.
Of course the main disadvantage of ActiveX Viewer is it's ActiveX component. ActiveX components officially operate only with IE and Windows. In our days the usage share of IE is only ~60%. Developers need more uniform technology that allows displaying and printing reports on the web. In ActiveReports6 ActiveX viewer is not supported but Flash Viewer is introduced instead.
Flash Viewer operates with any browser and any OS where the flash player is installed.
The bad news are Flash Viewer does not support no-touch printing.
So, it seems that there are no ways to implement no-touch printing on the web with ActiveReports6? Not exactly!
<body onload="window.setTimeout('em.PrintAll();', 5000);">
<span style="font-size: large;">Please wait for a few seconds and the printing will be starting.</span>
<embed id="em" width="0" height="0" src="HelloWorld.rpx?OutputFormat=PDF" />
The code uses EMBED tag to host the PDF document which is returned by RPX handler. PrintAll method prints the entire document without displaying a user dialog box. There are two issues with that code. First of all, it uses the timeout approach to wait until the document is loaded in PDF viewer. I think it's possible to intercept the event which is raised by PDF control when the document loading is completed, I just don't know the exact way to do that. The second issue is the warning which appears before printing starts:
Once "Don't show this message again" checkbox is unchecked, the code provides the no-touch printing, really.
Great Silver Hope
Eventually we will add the Silverlight-based Reports Viewer for ActiveReports. At the moment the most recent version of Silverlight is v.4 Beta 2 and it's new features list includes:
Comprehensive printing support enabling hardcopy reports and documents as well as a virtual print view, independent of screen content.
Unfortunately, that "comprehensive printing support" does not include no-touch printing. The great review of Silverligh 4 printing is available here.
Perhaps the final version of Silverlight 4 or 5 will support no-touch printing. Then we will add the Silverlight-based Reports Viewer and no-touch printing will be fully supported in ActiveReports. That's what I called "Great Silver Hope":)