title: SSRS 'Zebra striping' not working as expected
body: <p>Why isn't 'ALT' (variable used to determine row colour) being updated (see pic)</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Private Alt As Boolean
  Private cnt as integer
  Function Stripe(ByVal NewRow As Boolean, ByVal OddColor as String, ByVal EvenColor as String) As String
      If NewRow Then 
  Alt = Not Alt ' Trip the switch denoting a new row
  cnt = cnt + 1
  end if
      If Alt Then
          Return OddColor
      Else
          Return EvenColor
      End If
  End Function
  
  Function getalt () as boolean
  return alt
  end function    
  
  function getcnt() as integer
  return cnt
  end function
  </code></pre>
  
  <p>here is the code that goes in the 'background color'
  first column:</p>
  
  <pre><code>=Code.Stripe(true, "#E7E7E7", "Transparent")
  </code></pre>
  
  <p>second to N columns:</p>
  
  <pre><code>=Code.Stripe(False, "#E7E7E7", "Transparent")
  </code></pre>
  
  <p>n.b. you may need to open the image in another window to see the debug output - I'm showing the values of 'cnt' and 'alt' using getalt &amp; getcnt</p>
  
  <p><img src="https://i.stack.imgur.com/tSMmf.png" alt="enter image description here"></p>