This topic is locked

Custom Format Problem!

6/8/2008 11:55:38 AM
ASPRunnerPro General questions
M
mardisr author

i have the following code:
' return custom expression

Function CustomExpression(strValue, data, field, table)
If table = "dbo.OrderHeader" And field = "JobStatus" Then

str = "<table width=100% bgcolor="

if strvalue= "ON HOLD" then

str = str & "red"

else

str = str & ""

end if

str = str & "><tr><td>" & strValue & "</td></tr></table>"

strValue = trim(str)
End If
It works correctly except that the field which the color is applied loses its center. That is before the column had this format applied, data was centered within the cell. Now I can't seem to get the contents of the cell centered and have the above applied. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=8731&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />

J
Jane 6/18/2008

Hi,
try to use this code:

str = "<table width=100% align=center bgcolor="

if strvalue= "ON HOLD" then

str = str & "red"

else

str = str & ""

end if

str = str & "><tr><td align=center>" & strValue & "</td></tr></table>"

strValue = trim(str)