Hi all,
I need your help:
I have 3 prompt values:
-Building Name(ParamBuilding) (multiselect)
-Type(ParamType)
-Subtype(ParamSubType) (multiselect)
I have to display conditional blocks containing graphics using a string variable.
I want to display data from 1 Building and multiple Sub-Type OR multiple Buildings and 1 Sub-Type OR multiple Buildings and multiple sub-Type
For exemple: Building A, Building B, Type1, subType1.
So i use this expression:
if ((ParamValue('ParamSubType') = 'SubType1') OR (ParamValue('ParamSubType') = ' SubType2')) THEN 'graph1'
This expression works fine.
Second exemple: Building A, Type1, subType1 AND subType2 OR Building B, Type2, subType1 AND subType2 AND subType3,...
Third exemple: Building A, Building B, Type1, subType1 AND subType2,...
-I tried ParamValue('ParamSubType') = 'SubType1, SubType2'
but it doesn't work :(
-What kind of expression do i have to use for these two exemples?
(Sorry for my approximate english :-[)
QuoteParamValue('ParamSubType') = 'SubType1, SubType2'
Should be:
ParamValue('ParamSubType') in ('SubType1, SubType2')
Quote from: PRIT on 08 Mar 2011 06:40:24 AM
Should be: ParamValue('ParamSubType') in ('SubType1, SubType2')
I already tried it , doesn't work too ???
Could you please check what your ParamValue returns? Is it a String or Integer?
If Integer then the expression should be, e.g ParamValue('ParamSubType') in (1,2)
If String: ParamdisplayValue('ParamSubType') in ('SubType1, SubType2')
Quote from: PRIT on 08 Mar 2011 06:56:14 AM
Could you please check what your ParamValue returns? Is it a String or Integer?
If Integer then the expression should be, e.g ParamValue('ParamSubType') in (1,2)
If String: ParamdisplayValue('ParamSubType') in ('SubType1, SubType2')
It returns a string, it is wierd because :
it works when i choose multiple Buildings and 1 subtype
it doesn't work when i choose 1 building and multiple subtypes
I'm lost :-\
The problem seems to come from elsewhere...
It reminds me a similar situation i had faced before.
Create a string variable with below expression:
ParamDisplayBuilding+'-'+ParamDisplayType+'-'+ParamDisplaySubType
Get all the possible results. E.g.
Buliding A-SubType1-Type1
Building A-SubType2-Type1
Building B-Subtype1-Type1
so on
Use this variable for your conditional block. This should help.
Thanks
Prit
Quote from: PRIT on 08 Mar 2011 07:57:05 AM
It reminds me a similar situation i had faced before.
Create a string variable with below expression:
ParamDisplayBuilding+'-'+ParamDisplayType+'-'+ParamDisplaySubType
Get all the possible results. E.g.
Buliding A-SubType1-Type1
Building A-SubType2-Type1
Building B-Subtype1-Type1
so on
Use this variable for your conditional block. This should help.
Thanks
Prit
So i created a String variable with this expression:
ParamDisplayValue('ParamBuilding')+'-'+ParamDisplayValue('ParamType')+'-'+ParamDisplayValue('ParamSubType')
I added values like "Buliding A-Type1-SubType1"
I put the value as render variable for my Conditionnal container==> It doesn't work. :-\
Without condition results are as expected:
- If i choose multiple Buildings and 1 subType ( And put the Building item ,from the query, in the graphic Serie option )
(http://img25.imageshack.us/img25/1002/multibat.jpg)
- If i choose 1 Building and multiple subType ( And put the subtype item ,from the query, in the graphic Serie option )
(http://img848.imageshack.us/img848/3703/multisub.jpg)
It's Hard to explain on a forum :o Thank's for your help!
I just want to display these in two different graphics (with conditionnal display)
Maybe there's an other way to do that?
Quote from: PRIT on 08 Mar 2011 07:57:05 AM
It reminds me a similar situation i had faced before.
Create a string variable with below expression:
ParamDisplayBuilding+'-'+ParamDisplayType+'-'+ParamDisplaySubType
Get all the possible results. E.g.
Buliding A-SubType1-Type1
Building A-SubType2-Type1
Building B-Subtype1-Type1
so on
Use this variable for your conditional block. This should help.
Thanks
Prit
Hello, i tried it with an exemple, it works well!
I used static choice to fill my prompt value.
So my problem come from elsewhere >:(
It should work too with prompt value filled by datasource, I suppose?
Difficult to guess though, since you say it's working fine with the Static Choice but fails with value.
Create a data item with the same expression but with the Parameters not Paravalue/ParamvalueDisplay as shown below
[Data Item1:] ?Building?+'-'+?Type?+'-'+?SubType?
Use this Data Item your String Variable and see if it helps? Do a small test rather with your big report. :)
Quote from: PRIT on 09 Mar 2011 04:32:02 AM
Difficult to guess though, since you say it's working fine with the Static Choice but fails with value.
it works: (multiple or single) select with static choice (2 prompt)
with this code
ParamDisplayValue('Param1')+'-'+ParamDisplayValue('Param2')
it works too with this code
if (ParamDisplayValue('Param1') = 'choice1' AND ParamDisplayValue('Param2') = 'choice2') THEN 'choice1, choice2'
it works : single select with value from datasource (
1prompt)
with this code
if ParamValue('Param3') = 'choice1' THEN 'choice1'
doesn't work: multiple select (1 prompt) , (single or multiple) select (2prompt)
whit this code
//multiple select (1 prompt)
if ParamValue('Param3') = 'choice1, choice2' THEN 'choice1, choice2'
if ParamValue('Param3') in ('choice1, choice2') THEN 'choice1, choice2'
//single select (2prompt)
if (ParamValue('Param3') = 'choice1' AND ParamValue('Param4') = 'choiceA') THEN ParamDisplayValue('Param3')+'-'+ParamDisplayValue('Param4')
if (ParamValue('Param3') = 'choice1' AND ParamValue('Param4') = 'choiceA') THEN 'choice1, choiceA'
The problem seems to come from the data source (when multiselect or multiprompt)
:oI'm lost :D
Quote from: PRIT on 09 Mar 2011 04:32:02 AM
Create a data item with the same expression but with the Parameters not Paravalue/ParamvalueDisplay as shown below
[Data Item1:] ?Building?+'-'+?Type?+'-'+?SubType?
Use this Data Item your String Variable and see if it helps? Do a small test rather with your big report. :)
How to create a new Data Item?
Finally, I use static value to bypass the problem :P
thank's for help
GOOD :D