You can use the ASP.NET WebForms Viewer control with .NET Framework 4.6.2 - 4.8.1. only.
The WebViewer control 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 RDLX report can be rendered in two modes - Paginated and Galley. Using galley mode, you can view the contents of the RDLX 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.
You should use the ReportName property to specify a report for the viewer to display. Also, you must add the api/reporting/* HTTP handler to your 'web.config' file and corresponding UseReporting call to 'Global.asax' for this ViewerType to work properly.
You need to update the Global.asax file as follows, assuming that you have added 'SectionReport1.cs' in the project's root:
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 |