COGNOiSe.com - The IBM Cognos Community

General Discussion => COGNOS certification => Topic started by: harika321 on 18 Jun 2009 05:50:09 AM

Title: Based on condition .. image should display.
Post by: harika321 on 18 Jun 2009 05:50:09 AM
Hi All,

I m facing on issue, Please help on this.

I want to display a image based on condition.

Ex: if country is india then india image should display

if country changes then images also sholud change.

Please tell me the procedure with example.

Advance thanks for your help on this?

Title: Re: Based on condition .. image should display.
Post by: NaviGator on 07 Jul 2009 09:22:38 AM
You can use a conditional block for this ..

create a block for each country, put the image in the background of each block. so when you change the country using a value prompt for example the block will appear that contains the required image
Title: Re: Based on condition .. image should display.
Post by: vij on 08 Jul 2009 04:52:17 AM
HI  harika321 ,\

as per your stated specification i am assuming that in your report you  have prompt for COUNTRY.try the given one......
1)lets assume that you have country values as  INDIA,CHINA,CANADA in Country Prompts.
2)take the 3 images in report page,each for every region.

3)Create a String Variable and add the values into it as INDIA,CHINA,CANADA.

4)put expression in it as......
"if (ParamDisplayValue('Parameter1')='INDIA')
then('INDIA')
else if (ParamDisplayValue('Parameter1')='CANADA')
then('CANADA')
else('CHINA')"

5)go to the report page click on an image for INDIA value to be displayed and in Properties pane at Left hand side click the Render Variable .

6)In that Select your created String variable and then uncheck the CHINA and CANADA values and keep check for INDIA value.

7)now next select another image for CHINA country.select the Render variable in that uncheck the INDIA and CANADA values and keep check for CHINA.

8)Do same for CANADA value.

now run the report.

hope it might reach at your expecation.


regards,
vij
:)