简体   繁体   English

ReportViewer中的SSRS导出返回401未经授权

[英]SSRS Export in ReportViewer returns 401 Unauthorized

My ASP.NET Application and SSRS reports are on different servers. 我的ASP.NET应用程序和SSRS报告位于不同的服务器上。 I could be able to show the reports to ReportViewer control. 我可以将报告显示给ReportViewer控件。

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. 远程服务器返回错误:(401)未经授权。

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 http://app-srv-01/MyApp/Reserved.ReportViewerWebControl.axd?ReportSession = exndkq453f3ugmmukx1kzq55&Culture = 1033&CultureOverrides = True&UICulture = 1033&UICultureOverrides = True&ReportStack = 1&ControlID = 0a4973dfd17Typeb&Int = TypeIn&Position = Int&Type = Inc

This is the code assigning ReportViewer. 这是分配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();

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM