1
votes

My ASP.NET Application and SSRS reports are on different servers. I could be able to show the reports to ReportViewer control.

But, When I try to export the report, It redirects to a Page, and shows the below error.

The remote server returned an error: (401) Unauthorized.

http://app-srv-01/MyApp/Reserved.ReportViewerWebControl.axd?ReportSession=exndkq453f3ugmmukx1kzq55&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=0a4973dfd17142b7b113aa602270b424&OpType=Export&FileName=ClientInvoicePrint&ContentDisposition=OnlyHtmlInline&Format=PDF

This is the code assigning ReportViewer.

   ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
   ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://rpt-srv-01/ReportServer");
   ReportViewer1.ServerReport.ReportPath = "/MyReports/Quotes_Invoices/ClientInvoicePrint";
   ReportViewer1.ServerReport.Refresh();
1

1 Answers

1
votes

I think it should be like this ..

 ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
   ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://rpt-srv-01/ReportServer");
   ReportViewer1.ServerReport.ReportPath = "http://rpt-srv-01/ReportServer/MyReports/Quotes_Invoices/ClientInvoicePrint";
   ReportViewer1.ServerReport.Refresh();