简体   繁体   English

我有一个运行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

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 我有一个运行Windows窗体的应用程序在具有SRSS报告提示错误的LAN上运行HTTP请求失败401未经授权,但在我的PC上运行良好

reportViewer2.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
reportViewer2.ServerReport.ReportServerUrl = new Uri("http://mysystemname/ReportServer");
reportViewer2.ServerReport.ReportPath ="/InventoryReports2019/StockRegister";
reportViewer2.ShowParameterPrompts = false;
this.reportViewer2.RefreshReport();

try this may be it will help you and try to give full path of your report i think you are missing credentials option 尝试这可能会有所帮助,并尝试提供报告的完整路径,我认为您缺少凭据选项

    reportViewer1.ProcessingMode = ProcessingMode.Remote;  

    ServerReport serverReport = reportViewer1.ServerReport;  

    // Get a reference to the default credentials  
    System.Net.ICredentials credentials =  
        System.Net.CredentialCache.DefaultCredentials;  

    // Get a reference to the report server credentials  
    ReportServerCredentials rsCredentials =  
        serverReport.ReportServerCredentials;  

    // Set the credentials for the server report  
    rsCredentials.NetworkCredentials = credentials;  

    // Set the report server URL and report path  
    serverReport.ReportServerUrl =   
        new Uri("https:// <Server Name>/reportserver");  
    serverReport.ReportPath =   
        "/AdventureWorks Sample Reports/Sales Order Detail";  

    // Create the sales order number report parameter  
    ReportParameter salesOrderNumber = new ReportParameter();  
    salesOrderNumber.Name = "SalesOrderNumber";  
    salesOrderNumber.Values.Add("SO43661");  

    // Set the report parameters for the report  
    reportViewer1.ServerReport.SetParameters(  
        new ReportParameter[] { salesOrderNumber });  

    // Refresh the report  
    reportViewer1.RefreshReport();

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

相关问题 在C#窗口应用程序中SSRS报告呈现中出现错误:请求失败,HTTP状态为401:未经授权 - Getting Error in SSRS report rendering in C# window application: The request failed with HTTP status 401: Unauthorized 错误请求失败,HTTP状态为401:未经授权 - Error The request failed with HTTP status 401: Unauthorized 请求失败,HTTP 状态为 401:未授权 IN SSRS - The request failed with HTTP status 401: Unauthorized IN SSRS 请求失败,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 问题:在运行我的应用程序时使用Windows 7,未经授权的访问异常 - Question: Using Windows 7, Unauthorized Access Exception when running my application 在PC运行时如何识别WOL(局域网唤醒)请求 - How to recognize a WOL (Wake On Lan) request while the PC is running 请求失败,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
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM