Skip to Content
avatar image
Former Member

coloring alternate rows for a list

How to color alternate rows in a datawindow list

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

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

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 18, 2016 at 04:57 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 18, 2016 at 04:51 PM

    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)'") 
    ,
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 19, 2016 at 06:00 AM

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

    Add comment
    10|10000 characters needed characters exceeded