I have a report to which I have execute-only access - I don't have the access to the RDL file. This report exposes several parameters which I would like to set from URL.
I've successfully changed some parameters using the standard param=data form (as explained here: http://msdn.microsoft.com/en-us/library/ms153586.aspx). However, some parameters don't have the same parameter-prompt and parameter-name.
Unfortunately, to pass parameter values by URL I must know the name of the parameter and I don't see how I can deduct from the report and its parameters prompt tex开发者_运维问答t. I've tried to inspect the source and post-data but to no avail.
Anyone has an idea?
Thanks
P.S I also stumbled on this: http://odetocode.com/Articles/123.aspx. However, I wasn't able to connect to the web-services of my report server.
Ugh. I'm replying to myself, hopefully someone can learn from it:
I did it, eventually, using Reporting Services web service as described here and here. A point to remember here is that the name of the service has been changed (I believe from SQL server 2005 and onward) endpoint is ReportService2005.asmx.
After adding the web reference I was still having various problems. To summarize, this is the code that eventually worked for me (note: I am in domain and the IIS I'm connecting to requires domain windows auth).
ReportParameter[] parameters;
const string historyId = null;
const bool forRendering = true;
ParameterValue[] values = null;
DataSourceCredentials[] credentials = new DataSourceCredentials[] {};
ReportingService2005SoapClient c = new ReportingService2005SoapClient();
c.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("USERNAME", "PASSWORD", "DOMAIN");
c.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
c.GetReportParameters
(
"/CycleStatus/Builds Score",
historyId,
forRendering,
values,
credentials,
out parameters
);
However, I was plagued by the following error:
"The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'"
To handle that you need to change, in your app.config the security node, like so:
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
After that everything worked fine.
精彩评论