Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » dynamically changing the column values color
dynamically changing the column values color [message #286552] Sat, 08 December 2007 03:42 Go to next message
udaytapal
Messages: 6
Registered: December 2007
Location: Navi Mumbai
Junior Member
Hi All,

Right now i am doing R&D on Oracle Application Express. In that i am generating Report using SQL Query.

My question is for a particular column values, i want to set different color based on the value i get.

for example:
if the column value is < 0 then i want to display the value in 'red' color else if the column value is > 100 and < 500 i want to set/display the value in 'blue' color else the column value should be displayed in 'green'. how can i achieve this


I am able to set the color for entire column to given color

In Report Attributes Tab--> Column Attributes --> Column Formatting --> HTML Expression = <font color='blue'>#myColumn#</font>


Thanks in advance.

Regards
Uday

[Updated on: Sat, 08 December 2007 03:43]

Report message to a moderator

Re: dynamically changing the column values color [message #286563 is a reply to message #286552] Sat, 08 December 2007 04:44 Go to previous messageGo to next message
patrick_wolf
Messages: 11
Registered: August 2007
Location: Vienna, Austria
Junior Member
Hi Uday,

have a look at http://tylermuth.wordpress.com/2007/12/01/conditional-column-formatting-in-apex/
I think that's what you are looking for.

Patrick
Check out my Oracle APEX blog: http://inside-apex.blogspot.com/
Re: dynamically changing the column values color [message #286566 is a reply to message #286563] Sat, 08 December 2007 05:15 Go to previous messageGo to next message
udaytapal
Messages: 6
Registered: December 2007
Location: Navi Mumbai
Junior Member
Hi Patrik,

Thanks for your valuable reply. I got the solution what i was looking from few days. but as i am new to ORACLE Application Express, i just want to know where to write the query. Bit confused i hope it should be written in Region Definition > Source

if yes ,then there i have already written a query to return values. for your reference i am just pasting bit of query below which i have written for thatcolumn and tell me if anything need to change in that else i want to write the query somewhere else ? waiting for your valuable reply

[CODE]
(Sum(decodeyr(Trunc(date03),:p2_year, nvl(qty02,0)+ nvl(qty05,0)) )/
Decode(Sum(decodeyr(Trunc(date03),:p2_year,Nvl(qty01,0))),0,1,Sum(decodeyr(Trunc(date03),'2007', Nvl(qty01,0)))) ) * 100 "rate",
[CODE]

Regards
Uday
icon14.gif  Re: dynamically changing the column values color [message #286569 is a reply to message #286566] Sat, 08 December 2007 05:34 Go to previous messageGo to next message
udaytapal
Messages: 6
Registered: December 2007
Location: Navi Mumbai
Junior Member
Hi Patrick,

I did it successfully, i got the result. thanks once again
now "I AM ABLE TO SEE A LIGHT AT THE END OF THE TUNNEL LET ME REACH CLOSER TO THE LIGHT SO THAT I CAN SEE THAT AS BRIGHTER AS I CAN"

Regards
Uday
Re: dynamically changing the column values color [message #286668 is a reply to message #286569] Sun, 09 December 2007 11:31 Go to previous messageGo to next message
patrick_wolf
Messages: 11
Registered: August 2007
Location: Vienna, Austria
Junior Member
Good to hear that you got it working.
Re: dynamically changing the column values color [message #308217 is a reply to message #286668] Sat, 22 March 2008 07:41 Go to previous messageGo to next message
udaytapal
Messages: 6
Registered: December 2007
Location: Navi Mumbai
Junior Member
Hi I am Uday.

I have one requirement in Oracle Application Express. In that i am generating Report using SQL Query.

For example:
I am generating one report based on EMP table.EMP table has SAL column. If the SAL column value is < 1000 then my report is displaying the SAL column value in 'red' color else if the SAL column value is > 1000 report is displaying the value in 'green' color.And this report has "Export to Excel" option.

Now my question is,When i am clicking on "Export to Excel" i am getting EMP table data into excel sheet. But i am not getting the colors into that excel sheet. When i click on "Export to Excel" i want to show that SAL column values with colors based on that given condition in exel sheet also. How can i achieve this.Can we maintain the color and formatting when we export the report data into excel.

Thanks in advance.

Regards
Uday


Re: dynamically changing the column values color [message #308218 is a reply to message #308217] Sat, 22 March 2008 07:48 Go to previous messageGo to next message
patrick_wolf
Messages: 11
Registered: August 2007
Location: Vienna, Austria
Junior Member
Hi,

the "Excel" export of APEX is just a CSV file. It's not a native XLS file which can contain formating information.

But have a look at Denes Kubicek Excel Export package at

http://htmldb.oracle.com/pls/otn/f?p=31517:108

which offers more possibilities. Maybe it solves your problem.

Patrick
Check out my Oracle APEX blog: http://www.inside-oracle-apex.com/
Re: dynamically changing the column values color [message #308219 is a reply to message #308217] Sat, 22 March 2008 08:03 Go to previous message
udaytapal
Messages: 6
Registered: December 2007
Location: Navi Mumbai
Junior Member
Hi Patrick,

Thanks for your valuable information.

Regards
Uday


Previous Topic: multi value return from LOV
Next Topic: html_db change password
Goto Forum:
  


Current Time: Sat Dec 03 16:33:05 CST 2016

Total time taken to generate the page: 0.05608 seconds