Skip to Content
0

coloring alternate rows for a list

Oct 18, 2016 at 03:41 PM

183

avatar image
Former Member

How to color alternate rows in a datawindow list

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

avatar image
Former Member Oct 18, 2016 at 04:55 PM
0

Use the following for the detail band Color computed value:

if ( mod(getrow(),2) = 0, 536870912, 65535 )

In this example, 536870912 is Transparent and 65535 is Yellow.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 18, 2016 at 04:57 PM
0

If you do it in code like AV said or directly in the DataWindow like I suggested, you have to make sure all the objects on the detail band are using Transparent for Background Color.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 18, 2016 at 04:51 PM
0

I assume you mean to change the background color of the row. Use this code to set background color for alternate rows:

dw_1.Modify("datawindow.detail.Color='0~tIf(mod(getrow(),2)=0,134217728,553648127)'") 
,
Share
10 |10000 characters needed characters left characters exceeded
René Ullrich Oct 19, 2016 at 06:00 AM
0

If you need the colored rows on a printed report you have to select "Print Shows Background" in datawindows print properties.

Share
10 |10000 characters needed characters left characters exceeded