【问题标题】:How to execute an SSRS .rss script file in IIS/ASP.NET如何在 IIS/ASP.NET 中执行 SSRS .rss 脚本文件
【发布时间】:2014-03-10 17:48:14
【问题描述】:

我需要在 IIS 7.x 中运行的 ASP.NET 应用程序中执行 .rss SSRS 脚本文件。我该怎么做?

我是否必须将运行我的 Web 应用程序的 IIS AppPool 配置为具有提升的权限,以便我可以启动 rs.exe 控制台应用程序,将 .rss 脚本传递给它,就像我执行 .rss 脚本的方式一样IIS 之外的文件?

或者还有其他方法吗? Visual Studio/.NET 是否提供任何机制来引导 .rss 脚本文件而不需要 rs.exe 控制台应用程序?让 rs.exe 控制台应用程序可用于在 IIS 中运行的 Web 应用程序是我唯一的选择吗?

【问题讨论】:

  • 是否需要 .rss 脚本?根据您所做的工作,您也许可以仅使用 SSRS SOAP API 完成相同的任务。
  • 嘿 kyzen- 感谢您的回复。好吧,我们正在尝试从 ASP.NET Web 应用程序触发快照 OnDemand。我知道这样做的唯一方法是使用 .rss 脚本。 SOAP API 是否公开了触发快照的方法?您能否为我提供使用 SOAP API 执行此操作的良好参考,或者说明 ASP.NET Web 应用程序代码隐藏中的技术的代码 sn-p?我也会把它作为这个问题的答案发布:)

标签: asp.net iis reporting-services rs.exe


【解决方案1】:

所以,我想通了。如果您想知道如何使用 ReportServices2010 代理在您的 SSRS 报告服务器上创建报告的历史快照,这里有一个示例和一种方法,您可以完成它(非常感谢 kyzen 分享他在将我引导到 SOAP API 方面的见解):

Dim basicHttpBinding As New BasicHttpBinding()
basicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly
basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm
basicHttpBinding.SendTimeout = New TimeSpan(0, 10, 0)
Dim endPoint As New EndpointAddress("http://server/reportserver/ReportService2010.asmx")
Dim instance As New ReportingService2010SoapClient(basicHttpBinding, endPoint)
Dim itemPath As String = "/Path/to/report"
Dim warnings() As Warning
Dim historyId As String = Nothing
Dim values As ParameterValue() = Nothing
Dim credentials As DataSourceCredentials() = Nothing
Dim t As New TrustedUserHeader()
instance.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation
instance.ClientCredentials.Windows.ClientCredential = New Net.NetworkCredential("userid", "password", "domain")
instance.Open()

oServerInfoHeader = instance.CreateItemHistorySnapshot(t, itemPath, historyId, warnings)

在 C# 中:

BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
basicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly
basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm
basicHttpBinding.SendTimeout = New TimeSpan(0, 10, 0)

EndpointAddress endPoint = new EndpointAddress("http://server/reportserver/ReportService2010.asmx");
ReportingService2010SoapClient instance = new ReportingService2010SoapClient(basicHttpBinding, endPoint);
string itemPath = "/Path/to/report"
Warning warnings[];
string historyId;
ParameterValue values[];
DataSourceCredentials credentials[];
TrustedUserHeader t = new TrustedUserHeader();

instance.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
instance.ClientCredentials.Windows.ClientCredential = New Net.NetworkCredential("userid", "password", "domain");
instance.Open();

oServerInfoHeader = instance.CreateItemHistorySnapshot(t, itemPath, historyId, warnings);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-05
    • 2018-05-17
    • 1970-01-01
    • 1970-01-01
    • 2023-02-17
    • 1970-01-01
    • 1970-01-01
    • 2021-06-29
    相关资源
    最近更新 更多