locked
How to call SSRS in asp .net Project RRS feed

  • Question

  • User231977725 posted

    Hi Friends,
    I m new in SQl Server Reporting Services. I am unable to load SSRS in my asp .net 2008 project.

    Could you please solve my issuse and send me relevant code of asp .net using C#.
    Thankx

    With regards

    Abhishek Kumar
    9818028524

    Friday, June 27, 2008 2:52 AM

Answers

  • User-1148183825 posted


    Hi Friends,
    I m new in SQl Server Reporting Services. I am unable to load SSRS in my asp .net 2008 project.

    Could you please solve my issuse and send me relevant code of asp .net using C#.
    Thankx

    With regards

    Abhishek Kumar
    9818028524

     

    Hi Abhishek,

    To learn how to create reports, please visit below URL...

    http://nileshpupadhyay.blogspot.com/2008/05/simple-steps-for-developing-ssrs-report.html

    Now, to call the report into the ASPX page, please follow below steps...

    1.    Register the Microsoft.Reporting.WebForms into your ASPX page.

     

    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

    2.    After registering the assembly  you will be able to use ReportViewer control to fetch reports on your ASPX page. Below is the code for ReportViewer Control on ASPX page.

    <rsweb:ReportViewer runat="server" ID="MyReportViewer" Width="100%" Height="700px">
            </rsweb:ReportViewer>

    3.    Now, please find below code, which you will need to write into your ASPX.cs file...

     

    protected void Page_Load(object sender, EventArgs e)
    {
    	MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
    	MyReportViewer.ServerReport.ReportServerUrl = new Uri("http://reportserver/erports"); // Report Server URL
    	MyReportViewer.ServerReport.ReportPath = "EmployeeReport"; // Report Name
    	MyReportViewer.ShowParameterPrompts = false;
    	MyReportViewer.ShowPrintButton = true;
    
    	// Below code demonstrate the Parameter passing method. User only if you have parameters into the reports.
    	Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1];
    	reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter();
    	reportParameterCollection[0].Name = Perks.Constants.Pages.ClientAdmin.ShowInvoice.QueryStrings.INVOICEID;
    	reportParameterCollection[0].Values.Add(Request.QueryString[Perks.Constants.Pages.ClientAdmin.ShowInvoice.QueryStrings.INVOICEID].ToString());
    	MyReportViewer.ServerReport.SetParameters(reportParameterCollection);
    	
    	MyReportViewer.ServerReport.Refresh();
    }

     

    Reporting Services is very vast. Please try to refer other online contents and articles. Although if you have any doubts or query, please feel free to contact me.

    Regards,   

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 27, 2008 5:27 AM
  • User1805008792 posted


    I am unable to load SSRS in my asp .net 2008 project.

    Hi Abhishek,

    How are you trying to do this?

    What method you are using to load report in your application(Reporting Services SOAP API, the ReportViewer controls for Microsoft Visual Studio or URL access)?

    What issue are you facing?

    if you have just started the implementation then you must start from this article on how SSRS can be implemented in web applications -

    http://technet.microsoft.com/en-us/library/ms153697(SQL.100).aspx

    Best way is to use report viewer control as Nirav explained. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 30, 2008 9:51 AM

All replies

  • User-1148183825 posted


    Hi Friends,
    I m new in SQl Server Reporting Services. I am unable to load SSRS in my asp .net 2008 project.

    Could you please solve my issuse and send me relevant code of asp .net using C#.
    Thankx

    With regards

    Abhishek Kumar
    9818028524

     

    Hi Abhishek,

    To learn how to create reports, please visit below URL...

    http://nileshpupadhyay.blogspot.com/2008/05/simple-steps-for-developing-ssrs-report.html

    Now, to call the report into the ASPX page, please follow below steps...

    1.    Register the Microsoft.Reporting.WebForms into your ASPX page.

     

    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
        Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

    2.    After registering the assembly  you will be able to use ReportViewer control to fetch reports on your ASPX page. Below is the code for ReportViewer Control on ASPX page.

    <rsweb:ReportViewer runat="server" ID="MyReportViewer" Width="100%" Height="700px">
            </rsweb:ReportViewer>

    3.    Now, please find below code, which you will need to write into your ASPX.cs file...

     

    protected void Page_Load(object sender, EventArgs e)
    {
    	MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
    	MyReportViewer.ServerReport.ReportServerUrl = new Uri("http://reportserver/erports"); // Report Server URL
    	MyReportViewer.ServerReport.ReportPath = "EmployeeReport"; // Report Name
    	MyReportViewer.ShowParameterPrompts = false;
    	MyReportViewer.ShowPrintButton = true;
    
    	// Below code demonstrate the Parameter passing method. User only if you have parameters into the reports.
    	Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1];
    	reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter();
    	reportParameterCollection[0].Name = Perks.Constants.Pages.ClientAdmin.ShowInvoice.QueryStrings.INVOICEID;
    	reportParameterCollection[0].Values.Add(Request.QueryString[Perks.Constants.Pages.ClientAdmin.ShowInvoice.QueryStrings.INVOICEID].ToString());
    	MyReportViewer.ServerReport.SetParameters(reportParameterCollection);
    	
    	MyReportViewer.ServerReport.Refresh();
    }

     

    Reporting Services is very vast. Please try to refer other online contents and articles. Although if you have any doubts or query, please feel free to contact me.

    Regards,   

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 27, 2008 5:27 AM
  • User1805008792 posted


    I am unable to load SSRS in my asp .net 2008 project.

    Hi Abhishek,

    How are you trying to do this?

    What method you are using to load report in your application(Reporting Services SOAP API, the ReportViewer controls for Microsoft Visual Studio or URL access)?

    What issue are you facing?

    if you have just started the implementation then you must start from this article on how SSRS can be implemented in web applications -

    http://technet.microsoft.com/en-us/library/ms153697(SQL.100).aspx

    Best way is to use report viewer control as Nirav explained. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 30, 2008 9:51 AM
  • User-412143556 posted

    Hi,

    In your code I see how to specify ReportServerUrl but have a question regarding reportPath. What is report is not in the root on ReportServer but couple of folders down? 


    My report's URL is

    http://nareports/Reports/Pages/Report.aspx?ItemPath=%2fCBA+Development+Sandbox%2fMOC_01%2fMOC_R03_Individual

    can I assume that ReportServerUrl shoud be

    "http://nareports/Reports"

    and reportPath should be

    "%2fCBA+Development+Sandbox%2fMOC_01%2fMOC_R03_Individual"  ??

    thanks


    Wednesday, December 30, 2009 11:09 AM
  • User-1999135266 posted

    Hi,

    In your code I see how to specify ReportServerUrl but have a question regarding reportPath. What is report is not in the root on ReportServer but couple of folders down? 


    My report's URL is

    http://nareports/Reports/Pages/Report.aspx?ItemPath=%2fCBA+Development+Sandbox%2fMOC_01%2fMOC_R03_Individual

    can I assume that ReportServerUrl shoud be

    "http://nareports/Reports"

    and reportPath should be

    "%2fCBA+Development+Sandbox%2fMOC_01%2fMOC_R03_Individual"  ??

    thanks


    hi , did you get the answer to your post above? I have the exact same problem. What should the report path be in your case? PLEASE HELP

     

     

    Saturday, January 23, 2010 1:13 PM
  • User-2126390802 posted

    How to Configure ReportViewer for Remote Processing

    To configure a ReportViewer control for remote processing, specify a server report to use with the control. Follow these steps to select a server report:

    1. Add the ReportViewer control from the Data section of the Toolbox to the form or Web page in your project.

    2. In the ReportViewer Tasks smart tags panel, in Choose Report, select Server Report.

    3. In the Report Server text box, type the report server URL. The default URL syntax is http://localhost/reportserver. The actual URL that is used in your installation might be different depending on how the report server virtual directory settings are configured.

    4. In the Report Path text box, type the fully qualified path of a published report. The report path must start with a forward slash ( / ). The path must not include report URL parameters. The path consists of folders in the report server folder namespace and the name of the report. For example, if you installed the SQL Server 2005 sample report Company Sales on your report server, the report path might be /AdventureWorks Sample Reports/Company Sales.

    5. Build or deploy the application to verify that the report appears correctly in your application. If you receive HTTP proxy errors, verify that the report server URL is correct. If you receive a compatibility error, confirm that the report server is a SQL Server 2005 instance.

    6. Select the ReportViewer control and open the Properties window.

    7. Set properties on the ReportViewer control to configure the report toolbar and run-time functionality. Use the reference documentation to learn about each property. For more information, see ReportViewer Properties.

    Wednesday, May 5, 2010 3:55 AM