#1 2015-02-24 05:08:57

wtfacoconut
Member
Registered: 2015-02-24

How do I use "post-processing" with a Datasource Parameter

I have a Datasource Parameter that allows for multi-selection.

The query to generate options for this multi selection parameter (called: parentProjectNames) looks like this:
select name from parentProjects;

That parameter is going in to the primary query that looks something like the example below:
select * from childProjects where parentProject_id in (select id from parentProjects where name in ${parentProjectNames});

In the example query above, I NEED to make sure that "myDatasourceParameter" ends up looking something like the example below, but I don't know how to do this and need a little help please:
("projectName1", "projectName2", projectName3, ...)


Thanks!

Offline

#2 2015-02-24 16:13:27

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: How do I use "post-processing" with a Datasource Parameter

Hi,

for dynamic lists you could use the $X{} parameter. That is your query should be

select * from childProjects where $X{IN, parentProject_id, THE_PARAMETER_KEY}

Cheers
-Arno

Offline

#3 2015-02-24 17:40:48

wtfacoconut
Member
Registered: 2015-02-24

Re: How do I use "post-processing" with a Datasource Parameter

Arno,

Thanks you very much for the reply.  One more question, what is the $X{} parameter and what can be done with it? Is there documentation somewhere that lists out some other internal parameters like the $X{} parameter?

Offline

#4 2015-02-24 18:14:30

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: How do I use "post-processing" with a Datasource Parameter

Hi,

usually you use parameters as either $P{key} or simply ${key} which can be regarded as a typesafe replacement of the parameter value. The $X takes care of the special case for IN and NOTIN clauses. There is however quite a bit more to parameters which is all documented in the ReportServer admin guide http://www.reportserver.net/en/services/.

Hope this helps.

Cheers
Arno

Offline

Board footer

Powered by FluxBB