Hi
I have a simple 5 row 1 column table, row 1 is a header, row 2 and three are numeric fields, row 4 calculates the sum of row 2 and three, row five is a numeric field with a default value of 10. and the field is set to read only so that the user cannot change it.
What I am trying to do is have the text colour of row 4 change if the value is greater than that in row 5.
ie
if row 4.cell1 is >= to row5.cell1 then
row4.cell1 text color = "255,0,0"; // red
else row4.cell1 text color = "???,0,0"; //black ( I don't know the number for black)
endif
or something like this
Can you help.
//Add the values of the first two fields.
var mySum = Table1.Row1.Cell1.rawValue + Table1.Row2.Cell1.rawValue;
//Get the value of the default of the field at the bottom of the table.
var myDefault = Table1.Row4.Cell1.rawValue;
if(mySum > myDefault)
{
Table1.Row3.Cell1.font.fill.color.value = "255,0,0";
}
else
{
Table1.Row3.Cell1.font.fill.color.value = "0,0,0";
}
//Put the sum of the first two fields in the sum field.
this.rawValue = mySum;
You can see that the RGB value for Black is 0,0,0.
I'm not sure if this is the best way to do this or not. But it works for me. Maybe someone else could respond and say.
StevenD