ActiveReports 14 .NET Edition
ActiveReports 14 User Guide / Preview Reports / ASP.NET / Getting Started with the WebViewer
In This Topic
    Getting Started with the WebViewer
    In This Topic

    The WebViewer control that is licensed with the Professional Edition allows you to quickly display reports in Web applications. Once you drop the control onto a Web Form, you can look in the Visual Studio Properties grid and select the ViewerType that you want to use.

     

    The WebViewer control supports the following types:

    In a WebViewer, an RDL report can be rendered in two modes - Paginated and Galley. Using galley mode, you can view the contents of the RDL report in a single and scrollable page. You can set Galley mode through UI of the WebViewer or through code by setting RenderMode property to Galley.

    Note: The WebViewer and JSViewer are supported only in the Integrated pipeline mode. You will get PlatformNotSupportedException on using these Viewers in Classic pipeline mode.

    To use the WebViewer control

    1. In VSIDE, create a new ASP.NET Web Forms Application.
    2. To install nuget pakage for GrapeCity.ActiveReports.Web, go to Tools > Nuget Package Manager > Manage Nuget Packages for Solution..., browse for the package and click Install.
    3. In Solution Explorer, right-click the project and select Add > New Item.
    4. Select WebForm and click Add.
    5. Go to the Design tab of the newly added WebForm and drag and drop the WebViewer control to the WebForm designer.
      Note: if you get an error on adding the WebViewer control, you should install or upgrade the Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package. See Troubleshooting for details.

    To preview Code-Based Section Reports in WebViewer control

    You need to update the Global.asax file as follows:

    Global.asax.cs
    Copy Code
    public class Global : System.Web.HttpApplication
        {
            protected void Application_Start(object sender, EventArgs e)
            {
                this.UseReporting(settings =>
                {
                    settings.UseFileStore(new DirectoryInfo(Server.MapPath("~")));
                    settings.UseCompression = true;
                    settings.UseCustomStore(GetReport);
                });
            }
            public object GetReport(string reportName = "SectionReport")
            {
                SectionReport1 rpt = new SectionReport1();
                return rpt;
            }
        }
    
    Global.asax.vb
    Copy Code
    Public Class _Global
        Inherits System.Web.HttpApplication
        Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
            Me.UseReporting(Sub(settings)
                                settings.UseFileStore(New DirectoryInfo(Server.MapPath("~")))
                                settings.UseCompression = True
                                settings.UseCustomStore(AddressOf GetReport)
                            End Sub)
        End Sub
        Public Function GetReport(ByVal Optional reportName As String = "SectionReport") As Object
            Dim rpt As SectionReport1 = New SectionReport1()
            Return rpt
        End Function
    End Class