In the datawindow painter I can add the following "if" statement to
the background.color.
if ( isNull(#1), 12648384, 16777215)
This will make the background color white for column 1 if the value is
not null and light green if the value is null. If I look at the
Datawindow Syntax for column 1 I see the following.
background.color="16777215~tif ( isNull(#1), 12648384, 16777215)"
How can an "if" statement like the above be created using the
datawindow Modify function rather than the datawindow painter? I have
tried the following but none of them work.
dw_details.Modify("#1.Background.Color='16777215~tif ( isNull(#1),
12648384, 16777215)'")
dw_details.Modify("#1.Background.Color='16777215~~tif ( isNull(#1),
12648384, 16777215)'")
dw_details.Modify("#1.Background.Color='16777215~~~tif ( isNull(#1),
12648384, 16777215)'")
dw_details.Modify("#1.Background.Color='16777215~~~~tif ( isNull(#1),
12648384, 16777215)'")
Any help would be greatly appreciated. Thank you!
Try this:
String ls_name, ls_valid
Long i
FOR i = Long (dw_1.Describe ("datawindow.column.count")) TO 1 STEP -1
ls_name = dw_1.Describe ("#" + String (i) + ".Name")
ls_valid = dw_1.Describe (ls_name + ".background.mode")
IF ls_Valid <> '!' THEN
dw_1.Modify (ls_name + ".Background.Mode='0'")
dw_1.Modify (ls_name + ".Background.Color='16777215~tif(isnull(" +
ls_name + "), 12648384, 16777215)'")
END IF
NEXT
I added your recommendation to my code and then added the statement
below.
ls_attributes = dw_1.Describe("DataWindow.syntax")
The "~t" in your statement "dw_1.Modify (ls_name +
".Background.Color='16777215~tif(isnull(" +
ls_name + "), 12648384, 16777215)'")" appears as below in
ls_attributes for each of my columns. (The "~t" is interpreted as a
tab.)
background.color="16777215 if(isnull(eiacodxa), 12648384, 16777215)"
How can I keep the Modify function from interpreting "~t" as a tab?
I mentioned in my last post that the "~t" is converted to a tab when I
view the results of the Describe("DataWindow.syntax"). Previously, I
was not seeing the desired column color changes at runtime when the
"~t" showed up as a tab via the Describe("DataWindow.syntax"),
however, this time around the background is changing colors at runtime
as desired so all is well. Thank you for your help.
--
Dean Jones
CEO
PowerObjects
http://www.powerobjects.com
(612) 339-3355 Ext. 112
TeamSybase
* * Think Sybase * *
<meb.t...@gmail.com> wrote in message
news:380aae25-9cec-47e1...@n33g2000pri.googlegroups.com...
--
Dean Jones
CEO
PowerObjects
http://www.powerobjects.com
(612) 339-3355 Ext. 112
TeamSybase
* * Think Sybase * *
<meb.t...@gmail.com> wrote in message
news:380aae25-9cec-47e1...@n33g2000pri.googlegroups.com...