ActiveReports 6 Online Help
Provide One-Touch Printing in Web Applications (Pro Edition)

With the one-touch PDF printing, you can have the PDF output open in the browser with the Print dialog.

Note: To learn how to provide one-touch printing in the PDF output with Standard Edition, see Custom Web Exporting.
  1. From the Visual Studio File menu, select New Project...
  2. In the New Project dialog that appears, select ASP.NET Web Application (If you have the .NET Framework 4, in the Visual Studio 2010 New Project dialog that appears, select ASP.NET Empty Web Application).
  3. Rename the project and click the OK button.
  4. (For Visual Studio 2010 .NET Framework 4 only) From the Visual Studio 2010 Project menu, select Add New Item.
  5. (For Visual Studio 2010 .NET Framework 4 only) Select Web Form, rename it to Default.aspx and click Add.
  6. (For Visual Studio 2010 .NET Framework 4 only) In the Solution Explorer, right-click the Web Form that you have added and select Set As Start Page.
  7. From the Project menu, select Add New Item.
  8. Select ActiveReports 6 (xml-based) File, rename to MyReport.rpx, and click Add.
  9. In the Solution Explorer, right-click the References folder and select Add Reference.
  10. In the dialog that appears, go to .NET, select ActiveReports.Document.dll, ActiveReports6.dll, ActiveReports.PdfExport.dll, ActiveReports.HtmlExport.dll and ActiveReports.Web.dll, and click OK.
  11. In the Solution Explorer, open Web.config and add http handlers as follows.
    XML code. Paste in the XML view of the Web.config file inside the system.web section.
    Copy Code
    <httpHandlers>  
       <add verb="*" path="*.rdf.RdfItem" type="DataDynamics.ActiveReports.Web.Handlers.RdfHandler, ActiveReports.Web, Version=6.2.4209.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff"/>
       <add verb="*" path="*.rpx" type="DataDynamics.ActiveReports.Web.Handlers.RpxHandler, ActiveReports.Web, Version=6.2.4209.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff"/>
       <add verb="*" path="*.ActiveReport" type="DataDynamics.ActiveReports.Web.Handlers.CompiledReportHandler, ActiveReports.Web, Version=6.2.4209.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff"/>
       <add verb="*" path="*.ArCacheItem" type="DataDynamics.ActiveReports.Web.Handlers.WebCacheAccessHandler, ActiveReports.Web, Version=6.2.4209.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff"/>
    </httpHandlers>
    Note: You should update the Version and PublicKeyToken values to reflect the current version of ActiveReports installed on your machine. You can find the Version and PublicKeyToken values in the Global Assembly Cache (GAC), C:\WINDOWS\ASSEMBLY.
  12. On the Default.aspx page, add the following code to .aspx source.
    Paste into .aspx source to the body section between the div tags
    Copy Code
    <a href="MyReport.rpx?OutputFormat=PDF&Print=true" >Pdf print of rpx file</a>
  13. Run the project.
  14. On the Default page that opens in the browser, click the link Pdf print of rpx file to open the PDF file with the Print dialog.

Note: For an rdf file, your link may look similar to the following.

<a href="PdfPrintTest.rdf.RdfItem?OutputFormat=PDF&Print=true" >Pdf print of rdf file</a>

See Also

Walkthroughs

Getting Started