This topic is locked

Conditional Formatting

10/1/2007 1:18:32 PM
ASPRunnerPro Tips and tricks
A
ac163601 author

This will help show how to put conditional formatting in a Cell output by ASPRunner:
Anything with an should be removed, as it's only added for the benefit of this forum.
The key variables in this, are:
strValue = the cell value to be displayed and should not be renamed.

str= holds the HTML Tags and is split into two sections (one to open the TAGS and one for after the Cell value to close the TAGS: i.e. "str = str & strValue & str")

strFont= any conditons you may wish to enter for the font, some options are: <font size = 3 [color="#0000FF"]color = blue (or color = )>.

[color=#FF0000]IMPORTANT: Note, there are no quotes around these values in ASPRunner
In Cell Display, choose "Conditional Format" and copy/paste the code below:
str = "<table width=100% bgcolor="

strFont = "" [color=#9932CC] Initialise Font Tags. leave this blank for now
if strValue<=0 then

str = str & "lime"

end if
if strValue>0 AND strValue<30 then [color=#9932CC]
identify middle values and set background to Yellow

str = str & "gold"

end if
if strValue>=30 then

str = str & "red"

strFont=" color = #FFFFFF" [color=#9932CC] Black text is hard to read on red BG, so change colour (note the space before 'color')

if you want to change the font size as well, change this to

strFont =" color = #FFFFFF size = 3" (you choose the size)end if
str = str & "><tr><td><b><font"& strFont &">" & strValue & "</font></b></td></tr></table>"

strValue = str
combine all Tags and values together for final display
hope this helps someone else who needs it. I'm a newbie, and it took an age to work out.
cheers

Shandy