Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to change color of column in dynamic view depending on condition

Status
Not open for further replies.

lilly75

Programmer
Oct 3, 2002
2
0
0
US
how to change color of column in dynamic view depending on some condition when AgcData is based on Data Source Object(DSO).

for example: if taxrate>5 then that row should be displayed in red else in green.

ie., if taxrate>5 then "Band1" else "Band2" endif
for added column called [Bandname]



when AgcData is based on table, we can add one column with expression during creation of AgcData and specify condition there. but when it comes to DSO we can't add column with type expression..

thanks......
 
I am not quite sure I understand you correctly, but it sounds like you want to change the color of a column in a table from the result set of the AgcData. If this is what your trying to accomplish don't use data views, use a label set to true for setRawHTMLMode(true). Then use a stringbuffer that you write the HTML yourself and you can specify what the color of each column would be then.

eg:
Label1.setRawHTMLMode(true);
StringBuffer sb = new StringBuffer();
sb.append(&quot;<TABLE WIDTH=500>&quot;);
// 1st row
sb.append(&quot;<TR><TD BGCOLOR=GREEN>Column 1 AgcData0</TD>&quot;);
sb.append(&quot;<TD BGCOLOR=GREEN>Column 2 AgcData1</TD>&quot;);
sb.append(&quot;<TD BGCOLOR=Blue>Column 3 AgcData2</TD></TR>&quot;);
// 2nd row
sb.append(&quot;<TR><TD BGCOLOR=BLUE>Column 1 AgcData0</TD>&quot;);
sb.append(&quot;<TD BGCOLOR=GREEN>Column 2 AgcData1</TD>&quot;);
sb.append(&quot;<TD BGCOLOR=GREEN>Column 3 AgcData2</TD></TR>&quot;);
sb.append(&quot;</TABLE>&quot;);

Label1.setText(sb.toString());
 

hello AlexR,

I'm talking about the Dataviews on Form not HTML based Table.


thanks....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top