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

Conditional Formatting based on user's selection

Started by Nithesh UC, 26 Feb 2013 03:54:53 AM

Previous topic - Next topic

Nithesh UC

Hi Guys,

I am trying to format a column based on User's input value
There is a requirement where i need to format the column(Speed) based on User's input.
If user is giving <40 then RED and >40 and <80 is Blue and >80 is Green.
So In Advanced conditional style I'm writing a condition like "if (ParamDisplayValue('SpdLimit') < 40)
then ParamDisplayValue('SpdLimit')"
But I'm getting an error saying
"RSV-VAL-0002 Invalid expression if (ParamDisplayValue('SpdLimit') < 40)
then ParamDisplayValue('SpdLimit'). CRX-API-0003 A data type error ocurred at or near the position '32' in expression: 'if (ParamDisplayValue('SpdLimit') < 40)
then ParamDisplayValue('SpdLimit') '. The operand types ('string (varchar),integer') for operator '<' are not compatible."

FYI:I'm using Textbox Prompt for the Speed.

blom0344

Why not ParamValue when comparing with a numerical value?

dawells

I have used Advanced Conditional Styles and found that they don't like conditional statements like if/then/else and case imbedded in them. Is it possible to pass the user's input to a query data item, then drive your conditional style of that query? Let me know if you this helps. Thanks.

Lynn

Your expression for the advanced style should be boolean so it evaluates to true or false. Also, your expression should refer to a data item in your query. You can use the report casting function to convert the text input from the user to the desired datatype for comparison to your query item.

For example, you could define this expression and then click the pencil icon next to style and set the background color to red.
[Query1].[YourItem] < string2int64 ( ParamDisplayValue('SpdLimit') )

You can add more conditions to the style to deal with blue and green, but presumably you have another parameter where you'd get the other number from the user (unless 80 is a hard-coded set figure).

Hope this helps.

Nithesh UC

First of all Thank u guys for all your suggestions..

I have achieved it like by taking user's selection to a query item and defining some identity in the query for the particular speed limit.
Like If(Spd < 'p_LowSpd') then ('Red') else if(Spd between 'p_LowSpd' and 'p_HSpd' ) then ('Green') else ('Blue') name this query as 'Spd'
Then for that query based on the identity i did advanced conditional style.
if 'Spd' = 'Green' edit the background color as Green and repeat this for the remaining.


Thanks
uC