[英]Getting Error in SSRS report rendering in C# window application: The request failed with HTTP status 401: Unauthorized
I have 1 SSRS Report that deployed on server. 我有1个SSRS报告已部署在服务器上。 I am able to access and see the report in ReportViewer in Test Application(C# Window Application).
我可以在测试应用程序(C#窗口应用程序)的ReportViewer中访问并查看报告。 But I am not able to access/run the same report in my actual actual application with same piece of code., getting error on the line where I am setting parameters to reportviewer.
但是我无法使用相同的代码在我的实际实际应用程序中访问/运行相同的报告。
Here is the code block that i am using in both Test and Actual Application: 这是我在测试和实际应用程序中都使用的代码块:
ReportParameter[] parameters = new ReportParameter[3]; ReportParameter []参数=新的ReportParameter [3];
rptViewer.Reset();
rptViewer.ProcessingMode = ProcessingMode.Remote;
rptViewer.ServerReport.ReportPath = "/LIVE Reports/LicenceReport";
rptViewer.ServerReport.ReportServerUrl = new Uri(@"http://X3dRF45CC/Reportserver", System.UriKind.Absolute);
parameters[0] = new ReportParameter("IN_TIME_PERIOD_FLAG", txtType.Text, false);
parameters[1] = new ReportParameter("IN_PLAN_VERSION_ID", txtPlanVersion.Text, false);
parameters[2] = new ReportParameter("IN_MEDIA_OUTLET_ID", txtNetwork.Text, false);
// Getting error at this below line in Actual App (but not in Test App)
rptViewer.ServerReport.SetParameters(parameters);
rptViewer.RefreshReport();
Please someone help, I am wondering from last 2 days. 请有人帮忙,我想知道最近2天以来的情况。
If your report server is running under windows authentication. 如果报表服务器在Windows身份验证下运行。 Then it is possible that when you run the report using test application (which is running with user context having correct permissions) it runs fine.
然后,当您使用测试应用程序(以具有正确权限的用户上下文运行)运行报表时,它可能运行良好。 But when you run this in the actual application(which is not running in context of user with appropriate permissions) fails with 401 (UnAuthorized) error
但是,当您在实际应用程序中运行此程序时(未在具有适当权限的用户上下文中运行),失败并显示401(未经授权)错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.