Progress® Telerik® Reporting R2 2017

AJAX support

Note Note

This is a legacy report viewer and for new projects our recommendation is to use the latest web forms report viewer - HTML5 Web Forms Report Viewer

The main idea of Ajax requests is the elimination of full-page postbacks. In contrast, only the relevant parts of the page are updated, without a disturbing refresh. The markup that is transferred between the client machine and the server is reduced dramatically, which results in a significant performance improvement.

The Web ReportViewer can work both Telerik RadAjax and the native ASP.NET AJAX frameworks. Generally you do not have to apply ajax for the Web ReportViewer itself as all its commands are issued through an http handler and update only the report/report parameters areas and not the entire page.

So when might you need to use ajax in conjunction with the web report viewer? A valid case is when you want to change the Report on another control action e.g. button click.

Issue Ajax Request through Telerik RadAjaxManager

Add the instance of the ReportViewer to a RadAjaxManager control. You can optionally provide it with a loading panel, as shown below:

ASP.NET
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<telerik:ReportViewer ID="ReportViewer1" runat="server"></telerik:ReportViewer>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Button1">
          <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="ReportViewer1"/>
          </UpdatedControls>
        </telerik:AjaxSetting>
      </AjaxSettings>
</telerik:RadAjaxManager>

Example

protected void Button1_Click(object sender, EventArgs e)
{
    var typeReportSource = new Telerik.Reporting.TypeReportSource();
    typeReportSource.TypeName = "Telerik.Reporting.Examples.CSharp.ListBoundReport, CSharp.ReportLibrary";
    this.ReportViewer1.ReportSource = typeReportSource;
}

Issue Ajax Request through ASP.NET AJAX UpdatePanel

Wrap the instance of the ReportViewer into UpdatePanel ContentTemplate:

ASP.NET
<asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Button1" />
    </Triggers>
        <ContentTemplate>
           <telerik:ReportViewer ID="ReportViewer1" runat="server">
            </telerik:ReportViewer>
        </ContentTemplate>
    </asp:UpdatePanel>

Example

protected void Button1_Click(object sender, EventArgs e)
{
    var typeReportSource = new Telerik.Reporting.TypeReportSource();
    typeReportSource.TypeName = "Telerik.Reporting.Examples.CSharp.ListBoundReport, CSharp.ReportLibrary";
    this.ReportViewer1.ReportSource = typeReportSource;
}

See Also