This topic explains how to migrate the ActiveX viewer included in ActiveReports 3, 2, and 1.
In ActiveReports 6 or above, ActiveX viewer (ARVIEW2.CAB) is not provided with the product installer. You need to migrate a web application that includes ActiveX viewer on the Web form or contains the WebViewer with ViewerType property set to ActiveXViewer. In ActiveReports 12, you can use Flash viewer or the PDF export feature instead of ActiveX Viewer.
Before executing the actual migration, you can refer to the following alternate method. The alternate method is different for each ActiveReports edition. If you are using Professional edition, WebViewer (Flash viewer) is recommended. With the Flash viewer, you can use Flash component instead of ActiveX component to print or preview a report. If you are using Standard edition, you can use PDF export to preview or print a report with quality similar to that observed with ActiveX viewer.
You can use print and preview features with same quality as mentioned in alternate approach, however, some print features are disabled.
Not available in ActiveReports 12 |
Available in ActiveReports 12 |
||||
---|---|---|---|---|---|
Important Features | ActiveX Viewer | WebViewer (ActiveX) Professional Edition | WebViewer (Flash) Professional Edition | WebViewer (PDF) Professional Edition | PDF Export |
Direct printing from client printer | ○ | ○ | ○ | ○ | ○ |
Direct printing from client printer without preview | ○ | ○ | ○ | ○ | ○ |
Direct printing from client printer without preview (Windows print dialog is hidden ※1) | ○ | ○ | × | × | × |
Direct printing from client printer after changing settings (printer type, paper size etc.) | ○ (※3) |
○ (※3) |
○ (※2) |
○ (※2) |
○ (※2) |
Auto scaling | × | × | ○ (※4) |
× | × |
Automatic setting of page orientation | × | × | ○ (※5) |
× | × |
※1: In client printing, if you click Print button, Windows Print dialog is displayed. In ActiveX viewer you can hide the Windows Print dialog.
※2: In Windows Print dialog, similar to general Office application, you can select paper size or orientation.
※3: In addition to point ※2, the developer can set the desired page size or page orientation in the printer through client scripting before the user displays the Windows print dialog.
※4: A feature to perform scaling if the paper size specified while printing does not match to the paper size of report. This can be set through ScalePages property.
※5: A feature to adjust the page orientation if the print orientation specified while printing does not match the page orientation of the report. This can be set using AdjustPaperOrientation property.
If the ViewerType property is set to ActiveXViewer, you need to change it to FlashViewer or AcrobatReader. For example, modify the code marked in red like the following code.
Before migration
Visual Basic
|
Copy Code
|
---|---|
' Set the type of the selected view in ViewerType property of the Web viewer. Dim selection As String = Me.cboViewerType.Items(Me.cboViewerType.SelectedIndex).Text Select Case selection Case "AcrobatReader" Me.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.AcrobatReader Case "ActiveX viewer" Me.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.ActiveXViewer Case "HTML viewer" Me.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.HtmlViewer Case "RawHtml" Me.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.RawHtml End Select |
C#
|
Copy Code
|
---|---|
// Set the type of the selected view in ViewerType property of the Web viewer. { |
After migration
Visual Basic
|
Copy Code
|
---|---|
' Set the type of the selected view in ViewerType property of the Web viewer. Dim selection As String = Me.cboViewerType.Items(Me.cboViewerType.SelectedIndex).Text Select Case selection Case "AcrobatReader" Me.arvWebMain.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.AcrobatReader Case "Flash viewer" Me.arvWebMain.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.FlashViewer Case "HTML viewer" Me.arvWebMain.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.HtmlViewer Case "RawHtml" Me.arvWebMain.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.RawHtml End Select |
C#
|
Copy Code
|
---|---|
// Set the type of the selected view in ViewerType property of the Web viewer. { |
Re-create the application by referring the following basic operation or sample. Note that you don't need to re-create everything.
The basic difference between ActiveX viewer and PDF export is in the format of the data received from the web server to the client. An RDF file is generated on the Web server with ActiveX viewer and binary data of PDF format is created on the web server with PDF export. The other operations are common in ActiveX viewer and PDF export, there is no need to re-create the existing applications that are created using the ActiveX viewer.