Friday, March 9, 2012
ReportParameter.ValidValues
done everything but prompt the user for values. So there are a bunch
of reports with varied parameters. Some of these parameters are
hard-coded lists and others are DataSetReference. How do I provide the
subscriber with an accurate list of valid values?
I was thinking something like:
ReportParameters[0].reportParameter.ValidValues
but that comes back null.
I tried reportService.GetReportParameters(report, historyID,
forRendering, values, credentials)
Values comes back null.
Please help!
Thank you!
--Larry--"values" in GetReportParameters is used to validate parameter values.
Actual parameters are returned by GetReportParameters.
You can try something like this:
ReportParameter [ ] rp = reportService.GetReportParameters(report,
forRendering, historyID, null, credentials);
rp[0].ValidValues should contain valid values.
This posting is provided "AS IS" with no warranties, and confers no rights.
<lfarrell@.setfocus.com> wrote in message
news:1105590508.069271.235070@.c13g2000cwb.googlegroups.com...
>I have been assigned to create a new report subscription form. I have
> done everything but prompt the user for values. So there are a bunch
> of reports with varied parameters. Some of these parameters are
> hard-coded lists and others are DataSetReference. How do I provide the
> subscriber with an accurate list of valid values?
> I was thinking something like:
> ReportParameters[0].reportParameter.ValidValues
> but that comes back null.
> I tried reportService.GetReportParameters(report, historyID,
> forRendering, values, credentials)
> Values comes back null.
> Please help!
> Thank you!
> --Larry--
>|||Thank you, but that didn't work,
The ValidValues is <undefined value>
I used the following code:
ValidValue[] vv = new ValidValue[0];
parameters = server.GetReportParameters(thisfolder, null, false,
Paramvalues, Paramcredentials);
if (parameters.Length != 0)
{
vv = parameters[0].ValidValues;
}
when I look at parameter[0] (and 1 as well) I have ValidValues
<undefined value>
CalidValuesQueryBased = true
ValidValuesQueryBasedSpecified = true|||Thank you, but that didn't work,
The ValidValues is <undefined value>
I used the following code:
ValidValue[] vv = new ValidValue[0];
parameters = server.GetReportParameters(thisfolder, null, false,
Paramvalues, Paramcredentials);
if (parameters.Length != 0)
{
vv = parameters[0].ValidValues;
}
when I look at parameter[0] (and 1 as well) I have ValidValues
<undefined value>
CalidValuesQueryBased = true
ValidValuesQueryBasedSpecified = true|||Thanks to Daniel Dieb, I fixed my problem. He commented on a similar
post:
If ForRendering has a value of false, the parameter meta data returned
represents the parameter data that is currently associated with the
specified report. If any parameters values are based on a query and you
are
interested in returning the query-based parameters valid values list,
you
need to set ForRendering to true, In addition, for query based
parameters,
you need to ensure that you have passed in all of the credential
information
required to return the query parameters.
I set this parm to true and got my values!!
ReportParameter dependency problem
Hi,
I have a bunch of code for integrating reporting services 2000 with our application, which has been running fine for quite a while. We've recently encountered a problem and i can't quite figure it out.
There is a set of code that creates controls for entering parameter values for our reports, which takes an array of ReportParameters as an argument. We loop through the parameters and create controls as appropriate. The check to see if we need to create a dropdownlist of parameters populated through a query looks a bit like this:
if (oParam.ValidValues != null)
{
//Create ddl based on the list of valid values.
}
This is where i am encountering a problem. One of our reports, that has been running fine until recently is now not getting a dropdownlist created for it's second parameter. When i run into the code, i can see that this parameter now thinks that it has a dependency on the first parameter (which it does not), and the list of ValidValues is null.If i go into the report designer and change the order of the two parameters in the report, then it works fine, the list is populated and there seems to be no dependency. If i change it back, it is broken again. I've checked the query that populates the list, it is not parameterised and is a very simple kind of SELECT A, B FROM TABLEA. I've looked in the report parameters and i can see nothing there either.
Your help would be very much appreciated here. I am running SSRS with SP2 applied.
Paddy
Ok, fault is down to me (which is a good thing, cause at least i can start somewhere). We have been trying to alter the RDL file as it is uploaded into our application (and before it gets uploaded to reporting services). The idea being that we would input a parameter on every query that would reference the Globals!ReportName variable.
The particular problem seems to be coming when i have to create a whole QueryParameters nodelist, as the dataset in question is not parameterised.
This seems to be causing the problem where one dataset seems to depend on the other. I've compared the xml within the altered RDL with what would be there otherwise, and i can't see where the problem comes in. Has anybody else ever tried to do this and have any advice?