sameer gadade

sameer gadade

  • NA
  • 61
  • 55.4k

rdl reports from server in asp page

Jun 18 2013 10:21 AM
hi,
 i am using vs 4.0
 now my question is i want to call rdl report from server to my aspx page
but it gives me an error?
  • The request failed with HTTP status 401: Unauthorized.

  • ----------
    •  protected void Page_Load(object sender, EventArgs e)
              {
                  MyReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                  MyReportViewer.ServerReport.ReportServerCredentials = new ReportServerNetworkCredentials();

                  MyReportViewer.ServerReport.ReportServerUrl = new Uri(@"http://serverpath/Reports");
                  MyReportViewer.ServerReport.ReportPath = "Daily Reports/Facility Log";
                  MyReportViewer.ShowParameterPrompts = false;
                  MyReportViewer.ShowPrintButton = true;
                  //if report requires parameter
                  //Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1];
                  //reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter();
                  //reportParameterCollection[0].Name = "INVOICEID";
                  //reportParameterCollection[0].Values.Add("ABC011223");

                  //MyReportViewer.ServerReport.SetParameters(reportParameterCollection);
                  MyReportViewer.ServerReport.Refresh();
      }

      getting some error in line no 5 ie
         MyReportViewer.ServerReport.ReportServerCredentials = new ReportServerNetworkCredentials();

        can any one help me out please?????

Answers (1)