Hi all!
We've a problem trying to modify dynamic datawindow's fields with several colours. We've designed a function that seeks for holydays and weekends in the first column of datawindow, then it paints each day for all the rows of the day in the painted colums. We've tryied the modify string in the background colour dialog box in its dialog box, and it works in the datawindow's preview, but when we insert it in the modify method, we've syntax errors, maybe because of using of quotes. We've checked the quotes use with the modify examples in the powerbuilder coding examples, but it doesn't works. So here is the code, i will be thankful because it's the last work of the program:
string ls_casos_color
ls_casos_color = "'case( trim(right(C1, 2)) " + &
"when 'B' then if (trim(left(C1, 2)) = 'DS' or trim(left(C1, 2 )) = 'DG', rgb(255,0,0), rgb(255,64,64)) " +&
"when 'M' then if (trim(left(C1, 2)) = 'DS' or trim(left(C1, 2 )) = 'DG', rgb(255,0,0), rgb(255,128,128)) " +&
"when 'BM' then rgb(255,0,0) "+&
"else if (trim(left(C1, 2 )) = 'DS' or trim(left(C1, 2 )) = 'DG', rgb(255,0,0), rgb(255,255,255)))'"
string ls_propiedad_color
ls_propiedad_color = ".Background.Color = '" &
+ string(ll_sincolor) + &
+ "~tif (trim(left(C1, 2)) = " + ls_ds + "," + string(ll_color_BM) +"," + string (ll_sincolor) + ")"
long idx
string ls_aux
string err
for idx = 1 to upperbound (isa_colum) + 1
ls_aux = "C" + string (idx) + ls_propiedad_color
err = dw_resesdv.modify(ls_aux)
IF err <> "" THEN
MessageBox("Status", "Change to Background Color Failed " + err + "~r" + ls_aux )
END IF
next
return 0
Thank you!!
We've a problem trying to modify dynamic datawindow's fields with several colours. We've designed a function that seeks for holydays and weekends in the first column of datawindow, then it paints each day for all the rows of the day in the painted colums. We've tryied the modify string in the background colour dialog box in its dialog box, and it works in the datawindow's preview, but when we insert it in the modify method, we've syntax errors, maybe because of using of quotes. We've checked the quotes use with the modify examples in the powerbuilder coding examples, but it doesn't works. So here is the code, i will be thankful because it's the last work of the program:
string ls_casos_color
ls_casos_color = "'case( trim(right(C1, 2)) " + &
"when 'B' then if (trim(left(C1, 2)) = 'DS' or trim(left(C1, 2 )) = 'DG', rgb(255,0,0), rgb(255,64,64)) " +&
"when 'M' then if (trim(left(C1, 2)) = 'DS' or trim(left(C1, 2 )) = 'DG', rgb(255,0,0), rgb(255,128,128)) " +&
"when 'BM' then rgb(255,0,0) "+&
"else if (trim(left(C1, 2 )) = 'DS' or trim(left(C1, 2 )) = 'DG', rgb(255,0,0), rgb(255,255,255)))'"
string ls_propiedad_color
ls_propiedad_color = ".Background.Color = '" &
+ string(ll_sincolor) + &
+ "~tif (trim(left(C1, 2)) = " + ls_ds + "," + string(ll_color_BM) +"," + string (ll_sincolor) + ")"
long idx
string ls_aux
string err
for idx = 1 to upperbound (isa_colum) + 1
ls_aux = "C" + string (idx) + ls_propiedad_color
err = dw_resesdv.modify(ls_aux)
IF err <> "" THEN
MessageBox("Status", "Change to Background Color Failed " + err + "~r" + ls_aux )
END IF
next
return 0
Thank you!!