on 04-21-2013 3:21 PM
Hi All,
I have a report contains ,some sales fields. In that I have a parameter called highlighting the values are no color, segment wise, metric wise.
Now i need to apply color codes based on value selected in highlighting parameter.
1) If user selects segment wise in highlighting parameter then i need to highlight entire detail section except sales 1, sales 2 fields and no color selected no coloring required.
2) If user selects no color then no highlighting is required.
3) If user selects metric wise and if sales 1 > sales 2 then i need to highlight only sales 2 field and no color selected no coloring required for that field.
And if no value selected in highlighting parameter defaultly no color should be applied
Please suggest
Hi Vissu,
1) Right-click the Sales 1 field > Format Field > Font tab > click the formula button beside Color and use this code:
if {?Parameter} = "Metric Wise" then
(
if currentfieldvalue > {Sales 2} then
crBlue
else
crNoColor
)
else if {?Parameter} in ["Segment Wise", "No Color"] then
crNoColor
2) Go to the Sales2 field and use this code:
if {?Parameter} in ["Segment Wise", "No Color"] then
crNoColor
3) Then, go to each field in the detail section except Sales 1 and 2 and use this code:
if {?Parameter} = "Segment Wise" then
crBlue
else
crNoColor
These will color the fonts and not the fields/section itself. If you wish to color the section then apply the same formula by going to the Section Expert > Color tab.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhilash,
With below code segment wise is working fine,but when i select metric wise(The condition is if sales 2 > sales 1) the sales 2 field should be highlighted. But now when i select metric wise the sales 1 and sales 2 fields getting black background colors.and if no value selected in parameter list default no field will be applied.
If i select segment wise sales1 and sales 2 should also be highlited.
PFA For my requirement
This formula is applied only for sales 1 and sales 2
if {?Highliting} = "Metric Wise" then
(
if {Command.wr_actSale} > {Command.tarSale} then
crNoColor
)
else if {?Highliting} = "Segment Wise" then RGB (100,220,150)
else
crNoColor
Ok, go to Sales 2 field and apply this formatting formula:
if {?Parameter} = "Metric Wise" then
(
if currentfieldvalue > {Sales 1} then
crBlue
else
crNoColor
)
else if {?Parameter} = "Segment Wise" then
crBlue
else
crNoColor
Then, go the Sales 1 field and use this formula:
if {?Parameter} = "Segment Wise" then
crBlue
else
crNoColor
-Abhilash
Hi Abhilash,
It is working Please suggest this also.
if no value selected in parameter i should defaultly display no color.
And is there any formula that i need to highlight total detail section except sales 1 and sales 2(condition) when segment wise selected in parameter and if user selects metric wise then same condition as earlier.Because for formatting it is taking lot of time.
Please suggest
I mean to say that you need to use similar formulas to color the Details Section.
You'll also need separate formulas to color/uncolor Sales 1 and Sales 2 fields. The examples are all above and you can create similar formulas to color the fields/sections depending on the parameter you choose.
-Abhilash
Hi Abhilash one last question,
Suppose in details section->color tab->Background color->
i wrote below formula like this it will highlight all detail section,but i need to highlight except sales 1 and sales 2 if i select segment wise
if {?Parameter} = "Segment Wise" then
crBlue
else
crNoColor
Please suggest.
Yes, you then need to go to the Background formatting or the Font fomatting and create a formula that will paint either its background or the font in a different color.
In one of my previous replies I suggested a formula for the two Sales fields and you said it worked. So, use the same.
-Abhilash
Hi Abhilash,Thanks you for your support,its working fine.
Please suggest how to give default value for parameter ,i mean if i didn't select any value in Highliting parameter automatically it should be no color applied.
I tried by gave No color in default value of parameter
But i am getting all black background.
PFA
Hi Prathamesh,
I tried your formula but i am not getting the result.I am getting all black backgrounds.When no value selected it should not apply any color
PFA
if hasvalue({?Highliting})
then
(
if {?Highliting} = "Segment Wise" then
(
if {Command.wr_actSale} >= {Command.wr_tarSale} and {Command.wr_actSale}<>0 then
RGB(100,220,150)
else
crNoColor
)
else if {?Highliting} = "Metric Wise" then
crNoColor
else
crNoColor
)
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.