ActiveReports 18 .NET Edition
Developers / ActiveReports Version Compatibility and Migration / Upgrade Reports and References / ActiveX Viewer Migration
In This Topic
    ActiveX Viewer Migration
    In This Topic

    This topic explains how to migrate the ActiveX viewer included in ActiveReports 3, 2, and 1.

    Migration Requirements

    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 18, you can use the PDF export feature instead of ActiveX Viewer.

    To migrate project that uses ActiveXViewer as the ViewerType

    If the ViewerType property is set to ActiveXViewer, you need to change it to 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 WebViewer.
    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 WebViewer. 
    {
        string selection = this.cboViewerType.Items(this.cboViewerType.SelectedIndex).Text;
        switch (selection) {
            case "AcrobatReader":
                this.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.AcrobatReader;
                break;
            case "ActiveX viewer":
                this.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.ActiveXViewer;
                break;
            case "HTML viewer":
                this.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.HtmlViewer;
                break;
            case "RawHtml":
                this.arvWebMain.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.RawHtml;
                break;
        }
    }
    

    After migration

    Visual Basic
    Copy Code
    ' Set the type of the selected view in ViewerType property of the WebViewer.
     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 "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 WebViewer.
    {
         string selection = this.cboViewerType.Items(this.cboViewerType.SelectedIndex).Text;
         switch (selection) {
             case "AcrobatReader":
                 this.arvWebMain.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.AcrobatReader;
                 break;
             case "HTML viewer":
                 this.arvWebMain.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.HtmlViewer;
                 break;
             case "RawHtml":
                 this.arvWebMain.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.RawHtml;
                 break;
         }
     }
    

    To migrate project that uses PDF Export

    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. See CustomPreview sample for more information.