简体   繁体   English

在C#窗口应用程序中SSRS报告呈现中出现错误:请求失败,HTTP状态为401:未经授权

[英]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.

相关问题 请求失败,HTTP 状态为 401:未授权 IN SSRS - The request failed with HTTP status 401: Unauthorized IN SSRS 错误请求失败,HTTP状态为401:未经授权 - Error The request failed with HTTP status 401: Unauthorized 请求失败,HTTP状态为401:未经授权 - The request failed with HTTP status 401: Unauthorized 请求失败,HTTP状态为401:未授权。 - The request failed with HTTP status 401: Unauthorized. 请求失败,HTTP状态为401:未授权 - IIS升级 - WebService和Web应用程序 - The request failed with HTTP status 401: Unauthorized - IIS Upgrade - WebService & Web Application 请求失败,HTTP 状态为 401:调用 Web 服务时未经授权 - The request failed with HTTP status 401: Unauthorized while calling web service 请求失败,HTTP状态为401:再次尝试未授权 - Request failed with HTTP status 401: Unauthorized on second try 我有一个运行Windows窗体的应用程序在具有SRSS报告提示错误的LAN上运行HTTP请求失败401未经授权,但在我的PC上运行良好 - I Have a windows form application running on LAN having SRSS Report prompting error The HTTP request failed 401 unauthorized but running fine on my pc 链接到C#中的当前状态更新,获取错误(401)未经授权 - Linked In current-status update in c#, Getting Error (401) Unauthorized 服务器无法处理请求。 --->请求失败,HTTP状态为401:未经授权 - Server was unable to process request. ---> The request failed with HTTP status 401: Unauthorized
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM