Saturday, October 31, 2015

Call SSRS Report From ASP.NET





Call SSRS Report From ASP.NET

To call SSRS Report from ASP.NET Web application, go through below steps : 1. First of all open Visual Studio 2008 then go to  New >> WebsiteCall SSRS Report From ASP.NET-1   2. Then Browse the directory where you want to save New Web Site. Call SSRS Report From ASP.NET-23. Now In your web page add following controls:
  • One ScriptManager
  • One Button
  • One MicrosoftReportViewer
So your web page design will look like following: Call SSRS Report From ASP.NET-34. Now add following code on button’s click event in your .cs file :
?
1
2
3
4
5
6
7
8
9
10
11
12
13
using Microsoft.Reporting.WebForms;
try
{
    MyReportViewer.ProcessingMode = ProcessingMode.Remote;
    MyReportViewer.ServerReport.ReportServerUrl = new Uri("http://bhushan-pc:8080/ReportServer");
    MyReportViewer.ServerReport.ReportPath = "/StartSSRS/PersonAddressDetails";
    MyReportViewer.ServerReport.Refresh();
}
catch (Exception ex)
{
    Response.Write(ex.ToString());
}
Call SSRS Report From ASP.NET-45. Now Run your website and click on Get Report Button. It will show following results shown in web page : Call SSRS Report From ASP.NET-5Congratulations! We successfully called our SSRS report from ASP.NET web application.