【问题标题】:SSRS Set "Credentials stored securely in the report server" programmaticallySSRS 以编程方式设置“安全存储在报表服务器中的凭据”
【发布时间】:2015-01-10 04:02:39
【问题描述】:

我正在尝试将给定的 RDL 报告设置为使用我的客户端应用程序使用嵌入式数据源。我正在使用 ReportingService2005 类与 SSRS 进行交互。我需要将嵌入式数据源设置为使用“安全存储在报表服务器中的凭据”并指定用户名和密码。

谢谢!

【问题讨论】:

    标签: c# reporting-services datasource


    【解决方案1】:

    我通过首先发布 RDL,然后调用 ReportingService2005 GetItemDataSources() 方法解决了这个问题。然后我修改了该数据源并随后调用 SetItemDataSources() 将更改保存到 SSRS。以下是我完成此操作的代码的 sn-p:

    var reportItem = report.TargetFolder + "/" + report.Name;
    var dataSources = new DataSource[0];
    
    dataSources = rs.GetItemDataSources(reportItem);
    if (dataSources.Any())
    {
         var dataSource = (DataSourceDefinition)dataSources.First().Item;
         dataSource.CredentialRetrieval = CredentialRetrievalEnum.Store;
         dataSource.UserName = SsrsUsername;
         dataSource.Password = SsrsPassword;
    
         rs.SetItemDataSources(reportItem, dataSources);
     }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多