We help IT Professionals succeed at work.

To shade a row for a particular condition.

Mateen
Mateen used Ask the Experts™
on
PB7:

In a datawindow I have written this expression in every column.
if( diff<>0 , rgb(187,190,198), rgb(255,255,255))   [ written on Backgroun Colour Property ]
Because of this , the complete row is shaded if value of column diff<>0.

Is it possible to have the same effect by writing the above expression at one place only.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Please note that, If I write the expression in detail band then it will work in normal mode. It will not work in print preview mode.
Hi,

Ofcourse there is work around !!!!!!!!!.

Put one static text behind all columns and set background property for that static text control. Remember back ground color property for all columns should be 'TRANSPERANT'

Good Luck !!!!!!!

Regards,
Sandeep

Author

Commented:
Yes,
Your technique worked even in preview mode.
I have to put static text in [ ALL ] columns.

Is it possible to do the same by doing it at on place ( instead of ALL columns).

Thanks 4 your answer.




Hey,

why u need to pur static text in all columns.

Can't u put a single long static text which covers all columns  ?

Ofcourse instead of individual column in that row it will display entire row in different color. I mean there won't be any gape inbetween columns. Entire row will be of different color u set. But i think that should not be the problem for user.

Regards,
Sandeep

Author

Commented:
I am using grid datawindow.
Ohhhhhhhhhh,

Ok then another solution......

write a script to set property runtime rather design time.
Script should be written in constructor event for that datawindow like....


long ll_count, ll_col

ll_col = Long(This.Object.datawindow.column.count)

For ll_count = 1 To ll_col
     dw_list.Modify("#"+string(ll_count)+".background.mode = '2'")
     dw_list.Modify("#"+string(ll_count)+".background.color = '553648127~tif( diff<>0 , rgb(187,190,198), rgb(255,255,255))'")
Next

Hope this will work now.

Regards,
Sandeep
sorry,

in above solution 'dw_list' should be replaced with 'This' or your datawindow name.
To change the background color of a row based on a given value of a column in that row put a variation of the following in the datawindow's detail band color expression:
if(  code_status ="I",rgb(187,190,198),rgb(255,255,255))
The RGB combinations above will highlight "I"nactive codes with a gray background. Substitute your column and condition value to suit your needs.