reportviewer in .net RRS feed

  • Question

  • User-1209852231 posted

    I have created a ssrs report and managed to deploy it.
    From the initernet explorer I can browse to the report.
    I can select parameters and run the report.
    Now I would like to view this report from windows form in vs 2010.

    When I want to run view this report by running the winform code, the reportviwere comes up but there is a message which says:
    The source of the report definition has not been specified.
    How do I solve this please?

    This is the code to view the report:

     this.reportViewer1.ServerReport.ReportServerUrl = new Uri(@"http://" + Common.MachineName + ":1234/ReportServer");           
    this.reportViewer1.ServerReport.ReportPath = @"/Reports/" + _strReportName;

     Microsoft.Reporting.WinForms.ReportParameter[] RptParameter = new Microsoft.Reporting.WinForms.ReportParameter[1];
                    RptParameter[0] = new Microsoft.Reporting.WinForms.ReportParameter("RequestID", "2");


    Monday, September 19, 2011 5:56 AM


  • User-1528094326 posted

    Windows Forms uses the "ReportEmbeddedResource" instead of ReportPath

    Also you need to make sure you add the assembly name before it generally as well if its a resource in your win forms application. So if you have a project called MyProject then it would be like...

    ReportEmbeddedResource = "MyProject." + _strReportName;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 19, 2011 5:22 PM