Monday, March 26, 2012

GetReportParameters method not updating ReportParameters array.

I have developed a report that uses two 'datatime' parameters ('start date'
and 'end date'). I then introduced a third parameter ('Range') which
provides a difinitive list of integer values to select from.
On selecting one of the integer values from the 'Range' parameter, the
'start date' and 'end date' are updated accordingly (by applying
"=Code.GetStartDate(Parameters!Range.Value)" as the non-queried Default
Values of the 'start date' parameter properties, and similar for the 'end
date'). This works perfectly when run from the Report Manager (i.e. If I
select the third option (last month) from the 'Range' parameter, the code
will update the 'start date' value to the beginning of last month and the
'end date' value to the last day of last month).
I have also developed a C# user control that acts as a client side utility
for viewing reports on a specific server (using the Reporting Services
WebService provided). This applicatiuon works perfectly for all reports
with the exception of that described above. The problem lies in obtaining
the updated dates when selecting a 'Range' using the 'GetReportParameters'
method. I have no problem returning updated parameter values from Query
Dependant parameters, which causes me to believe that I am calling the
Method correctly, however the 'start date' and 'end date' default values do
not seem to be updated by the webservice despite passing the updated value
of the 'Range' parameter to the method.
Any information as to why the parameter values are not being updated
correctly would be helpful.
Below is a code snippet:
Thanks in advance.
----
ReportServer.ReportParameter[] parameters;
try
{
parameters = rs.GetReportParameters("/" +
reportPath,null,true,currentParamValues,null);
}
catch(System.Web.Services.Protocols.SoapException sex)
{
SoapException(sex);
return null;
}
----I am seeing something similar, only with a cascading parameter. I've
stripped it down to the simplest example I can think of... the report has 2
parameters, A and B. B has a valid values list based on a dataset that
requires A.
I call GetReportParameters( ReportName, false, null, null, null ) and both
parameters come back with parameter 2 dependent upon parameter 1. I then
provide a ParameterValue array with 1 entry for parameter A. I call
GetReportParameters( ReportName, true, null, parameterValues, null ) and I
get both parameters back but B has no valid values and the parameter's state
is HasOutstandingDependencies.
Have you determined what your parameter's state is after the
GetReportParameters call?
"Paul B" wrote:
> I have developed a report that uses two 'datatime' parameters ('start date'
> and 'end date'). I then introduced a third parameter ('Range') which
> provides a difinitive list of integer values to select from.
> On selecting one of the integer values from the 'Range' parameter, the
> 'start date' and 'end date' are updated accordingly (by applying
> "=Code.GetStartDate(Parameters!Range.Value)" as the non-queried Default
> Values of the 'start date' parameter properties, and similar for the 'end
> date'). This works perfectly when run from the Report Manager (i.e. If I
> select the third option (last month) from the 'Range' parameter, the code
> will update the 'start date' value to the beginning of last month and the
> 'end date' value to the last day of last month).
> I have also developed a C# user control that acts as a client side utility
> for viewing reports on a specific server (using the Reporting Services
> WebService provided). This applicatiuon works perfectly for all reports
> with the exception of that described above. The problem lies in obtaining
> the updated dates when selecting a 'Range' using the 'GetReportParameters'
> method. I have no problem returning updated parameter values from Query
> Dependant parameters, which causes me to believe that I am calling the
> Method correctly, however the 'start date' and 'end date' default values do
> not seem to be updated by the webservice despite passing the updated value
> of the 'Range' parameter to the method.
> Any information as to why the parameter values are not being updated
> correctly would be helpful.
> Below is a code snippet:
> Thanks in advance.
> ----
> ReportServer.ReportParameter[] parameters;
> try
> {
> parameters = rs.GetReportParameters("/" +
> reportPath,null,true,currentParamValues,null);
> }
> catch(System.Web.Services.Protocols.SoapException sex)
> {
> SoapException(sex);
> return null;
> }
> ----
>
>sql

No comments:

Post a Comment