If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Replace images based on report output

Started by akustw01, 28 Apr 2008 11:36:59 AM

Previous topic - Next topic

akustw01

I am trying to change an image based on the report output.

If a report is PDF, then use this image
else use this different_image.

This is what I have tried.

1. In report studio i add the image object from the insertable objects.

2. Under Properties >> Conditional >> URL Source Variable
I create a boolean Variable, with ReportOutput () in ('PDF')

3. Under Properties >> URL SOURCE
I change the source type to be Report Expression.
I change the report expression to be the following:

IF ( ReportOutput() = 'PDF' ) THEN
    ( <image_source> )
ELSE
    ( <alternate_image_source> )

I have also tried the following

IF ( ReportOutput() = TRUE ) THEN
    ( <image_source> )
ELSE
    ( <alternate_image_source> ).


In concept this seems to work; but in reality it does not.  Any suggestions would be helpful.

Thanks

almeids

ReportOutput() returns a string, not a Boolean, so you can't check for the value TRUE.  Try using the comparison ='PDF' (rather than "in") for your boolean variable.
I think conditional formatting/rendering has changed somewhat in C8 but in ReportNet I would put both images on the page and conditionally set their box types to None for true, false values of the variable respectively.

rockytopmark

You are on the right track...

How I might do it:

1. Create a Boolean Variable... expression: ReportOutput() = 'PDF'
2. Add a conditional block to the report for housing the images
3. Set the Conditional Block's "Block Variable" to use your boolean variable created in step 1
4. Click the Conditional Block and set the Current Block to No and put the Non-PDF image information in
5. Click the Conditional Block and set the Current Block to Yes and put the PDF image information in

akustw01

rockytopmark,

That worked, Questioned answered and solved. 

Thanks much

sudha gumpena

I was just practicing seeing whats happening in the forums...
i replicated that using boolean ..it worked fine.the pics changed during runtime
but failed while trying do it using string variable.
took 3 pics. it is fine when i declare the variables, saying box type = 'none' , i can see them getting blocked but in the run time it shows all three pics..be it in PDF,Excel & HTML.
do u have a trick to do this with string variable?????

rockytopmark

NO trick... just set up the variable properly.

Variable Expression:  reportOutput()

Values: HTML    PDF     CSV   ....

Each of these values will have a block in the Conditional Block for you to set the proper image on.