Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Conditionally change the colour of the text (APEX 4.0)
|
Re: Conditionally change the colour of the text [message #542776 is a reply to message #542773] |
Fri, 10 February 2012 03:02 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
If it is an interactive report, you can set it in Actions - Format - Highlight (set a condition in there).
Or, you could try with SELECT statement itself, such as
select
case when ver = 'Y' then
'<font color="red">' || milestone ||'</font>'
else
'<font color="green">' || milestone ||'</font>'
end milestone,
...
from ...
If you do the latter, pay attention to column's "Display As" column attribute - should be set to STANDARD REPORT COLUMN.
[Updated on: Fri, 10 February 2012 03:03] Report message to a moderator
|
|
|
|
Re: Conditionally change the colour of the text [message #542789 is a reply to message #542784] |
Fri, 10 February 2012 03:30 |
|
balckbandit5
Messages: 104 Registered: December 2011
|
Senior Member |
|
|
My query is now:
select
pm.MILESTONE_ID ||'' - ''||cp.CHECKPOINT_NAME "Milestone",
pm.MILESTONE_DATE "Date",
case when Ver = 'Y' then
'<font color="green">' ||
decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 1),1, 'Y', 0, 'N', 'N') ||'</font>'
else
'<font color="red">' || decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 1),1, 'Y', 0, 'N', 'N') ||'</font>'
end "Ver",
case when SnR = 'Y' then
'<font color="green">' ||
decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 2),1, 'Y', 0, 'N', 'N') ||'</font>'
else
'<font color="red">' || decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 2),1, 'Y', 0, 'N', 'N') ||'</font>'
end "SnR",
case when Som = 'Y' then
'<font color="green">' ||
decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 3),1, 'Y', 0, 'N', 'N') ||'</font>'
else
'<font color="red">' || decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 3),1, 'Y', 0, 'N', 'N') ||'</font>'
end "Som",
case when ITA = 'Y' then
'<font color="green">' ||
decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 4),1, 'Y', 0, 'N', 'N') ||'</font>'
else
'<font color="red">' || decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 4),1, 'Y', 0, 'N', 'N') ||'</font>'
end "ITA",
case when ITF = 'Y' then
'<font color="green">' ||
decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 5),1, 'Y', 0, 'N', 'N') ||'</font>'
else
'<font color="red">' || decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 5),1, 'Y', 0, 'N', 'N') ||'</font>'
end "ITF",
case when PMO = 'Y' then
'<font color="green">' ||
decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 6),1, 'Y', 0, 'N', 'N') ||'</font>'
else
'<font color="red">' || decode((select pmr.IS_APPROVED
from PMO_MILESTONE_REVIEW pmr
where pmr.MILESTONE_ID = pm.MILESTONE_ID
and pmr.ROLE_ID = 6),1, 'Y', 0, 'N', 'N') ||'</font>'
end "PMO"
from PMO_MILESTONES pm,
PMO_CHECKPOINT cp
where pm.PROJECT_ID = :P2_PROJECT_ID
and cp.checkpoint_ID = pm.checkpoint_ID
|
|
|
|
|
|
|
|
Re: Conditionally change the colour of the text [message #542841 is a reply to message #542825] |
Fri, 10 February 2012 06:49 |
c_stenersen
Messages: 255 Registered: August 2007
|
Senior Member |
|
|
I tried it, and for me it works with setting it to standard report column. I used a span tag with a style attribute rather than a font tag however. E.g <span style="color:green"> So maybe it's ignoring the font tag since it's rather using the css defined in the template.
|
|
|
|
Goto Forum:
Current Time: Wed Dec 11 16:31:47 CST 2024
|