This topic is locked

help please - conditional formatting

10/1/2007 6:48:01 AM
ASPRunnerPro General questions
A
ac163601 author

When using the custom format options, all pre-selected tags (bold, italics, font colour etc) are overwritten by whatever you enter into the option box.
The data Sergey gave me to allow conditional formatting to take place summarises into:
, where "strValue" is the cell value supplied by ASPRunner.
I am trying to add change the colour of the text in the cell depending on the result, and have tried almost every possibility (I assume obviously not all, or it would work).
"<table width=100% [color=#0000FF]font color = "#FFFFFF"bgcolor= "red"><tr><td><b>" & strValue & "</b></td></tr></table>"

"<table width=100% bgcolor= "red"><tr><td><b>" & strValue & "</b></td></tr></table>"

"<table width=100% bgcolor= "red"><tr><td><b> [color="#0000FF"]<font color = "#ffffff">" & strValue & "</b></font></td></tr></table>"
etc, etc etc...
Can someone who is more familiar with HTML than me, please advise....?
Cheers Much

Andrew

Sergey Kornilov admin 10/1/2007

Andrew,
this method creates a new table which means you cannot prevent formatting tags from being overwritten. You can add <b> <i> etc tags right in your code.

A
ac163601 author 10/1/2007

Sergey, understood about the Tags, and I am using that to add Bold etc etc, but I want to add a tag to to change the colour. Everything I read says use <font color = "#xxxxxx">, or <color = "#yyyyyy">, but I can't get it to work, no matter where I put it in the tags.
Any ideas?

Sergey Kornilov admin 10/1/2007
A
ac163601 author 10/1/2007

Sergey, thanks, but what is shown on this link, is the same as I am entering, but I only get an error as below:
Microsoft VBScript compilation (0x800A0401)

Expected end of statement

/CT_Dashboard/include/commonfunctions.asp, line 646, column 35

str = str & "><tr><td><font size ="3"><b>" & strValue & "</b></font></td></tr></table>"

As it is standard html, I can only assume it is the placement of the tag.
Sorry to drag this one on, but does anyone have any ideas, or has applied formatting to the Text Cell Values in any of their projects?
Thanks

Andrew

http://www.w3schools.com/tags/tag_font.asp

Sergey Kornilov admin 10/1/2007
str = str & "><tr><td><font size =3><b>" & strValue & "</b></font></td></tr></table>"
A
ac163601 author 10/1/2007

Thanks Sergey, I actually put a type in there and left quotes around the size by mistake.
I'm not sure how, but that worked on Color also. Everywhere you read, the <font color> tag should have the value enclosed by quotes ie <font color = "#FFFFFF"> etc.
However, for whatever reason, it only works if the quotes are left off, so it becomes <font color = #FFFFFF>, which does work..
Weird.
Thanks though.
Andrew


str = str & "><tr><td><font size =3><b>" & strValue & "</b></font></td></tr></table>"
A
ac163601 author 10/1/2007

ignore me. doh.