【问题标题】:Accessing SSRS server report from local application从本地应用程序访问 SSRS 服务器报告
【发布时间】:2014-02-10 12:39:20
【问题描述】:

我已在服务器中部署了我的 SSRS 报告。我是否可以从本地 Web 应用程序访问该报告。我在 web.config 中给出了服务器的凭据。但它仍然没有显示报告,它显示了一些错误,如Cannot create a connection to data source 'DataSource1'. (rsErrorOpeningConnection)

当我在服务器中托管相同的应用程序时,它工作得非常好。

谁能告诉我为什么无法从我的本地系统访问报告?

【问题讨论】:

    标签: asp.net reporting-services


    【解决方案1】:

    这不是我的代码,但理想情况下是您所要做的。我记得前段时间在以前的一个项目中成功使用过它

    private void ShowReport()
    {
        try
        {
            string urlReportServer = "http://sqlDBServer//Reportserver";
            rptViewer.ProcessingMode = ProcessingMode.Remote; // ProcessingMode will be Either Remote or Local
            rptViewer.ServerReport.ReportServerUrl = new Uri(urlReportServer); //Set the ReportServer Url
            rptViewer.ServerReport.ReportPath = "/ReportName"; //Passing the Report Path                
    
            //Creating an ArrayList for combine the Parameters which will be passed into SSRS Report
            ArrayList reportParam = new ArrayList();
            reportParam = ReportDefaultPatam();
    
            ReportParameter[] param = new ReportParameter[reportParam.Count];
            for (int k = 0; k < reportParam.Count; k++)
            {
                param[k] = (ReportParameter)reportParam[k];
            }
            // pass crendentitilas
            //rptViewer.ServerReport.ReportServerCredentials = 
            //  new ReportServerCredentials("uName", "PassWORD", "doMain");
    
            //pass parmeters to report
            rptViewer.ServerReport.SetParameters(param); //Set Report Parameters
            rptViewer.ServerReport.Refresh();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    

    参考:http://www.codeproject.com/Articles/675762/Call-SSRS-Reports-by-using-Csharp

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-08
      • 1970-01-01
      • 1970-01-01
      • 2010-11-18
      • 1970-01-01
      • 2022-01-13
      相关资源
      最近更新 更多