Show SSRS Report in ASP.NET Web Page

How to Integrate rdl file to asp.net page

  • Create a .aspx page
  • Add Report Viewr Control from tool box.
  • In .aspx.cs, Add Reference of Microsoft.Reporting.WebForms
    location: - c:\Program Files (x86)\Microsoft Visual Studio 10.0\ReportViewer\Microsoft.ReportViewer.WebForms.dll
  • Set the Processing Mode to Remote, if you want to show the report deployed on report Server
  • Pass the Report URL and Report Path
.aspx code
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>SSRS Report</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="600">
        <ServerReport
            ReportServerUrl="http://ServerName//Reportserver"
            ReportPath="/MyReport"
            DisplayName="SSRS Report from Report Server" />
    </rsweb:ReportViewer>
    </form>
</body>
</html>
.aspx.cs code
    private void ShowSSRSReport()
    {
        try
        {
            string urlReportServer = "http://ServerName//Reportserver";
            rptViewer.ProcessingMode = ProcessingMode.Remote; // ProcessingMode will be Either Remote or Local
            rptViewer.ServerReport.ReportServerUrl = new Uri(urlReportServer); //Set the ReportServer Url
            rptViewer.ServerReport.ReportPath = "/MyReport"; //Passing the Report Path               

            rptViewer.ServerReport.Refresh();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }