0

I need to execute a .rss SSRS script file within an ASP.NET application running in IIS 7.x. How can I do that?

Do I have to configure the IIS AppPool that is running my web application to have elevated privileges such that I can start up the rs.exe console application passing the .rss script to it the way I would otherwise execute an .rss script file outside of IIS?

Or is there another way? Does Visual Studio/.NET provide any mechanism for bootstrapping an .rss script file without needing the rs.exe console application? Is my only option to make the rs.exe console application available to my web application running in IIS?

classtemplateT
  • 111
  • 1
  • 7
  • Is an .rss script required? Depending on what you're doing, you might be able to accomplish the same tasks just using the SSRS SOAP API. – kyzen Mar 10 '14 at 18:43
  • Hey kyzen- thanks for the reply. Well, what we are trying to do is trigger a snapshot OnDemand from an ASP.NET web application. The only way I know to do that is with an .rss script. Does the SOAP API expose a method to trigger a snapshot? Can you maybe help me with either a good reference for using the SOAP API to do this, or a code snippet illustrating the technique in a codebehind of an ASP.NET web application? I'd post that as an answer to this question too :) – classtemplateT Mar 11 '14 at 04:19

1 Answers1

0

So, I figured it out. If you're wondering how to create a History Snapshot of a report on your SSRS Reports Server using the ReportServices2010 proxy, here's one example and one way you can accomplish it (many thanks to kyzen for sharing his insight in directing me to the 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)

and in 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);
classtemplateT
  • 111
  • 1
  • 7