Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No 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 my application server, not the report server. Hence shows this error.
Quote:
The remote server returned an error: (401) Unauthorized.

The URL of the PDF Export Page is shown as the below. It's supposed to be http://rpt-srv-01/
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


What I have tried:

I am assigning ReportServerUrl and ReportPath to the reportViewer to set the servername and reportpath. But it doesn't seems to work.

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();
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900