Databases Reference
In-Depth Information
Figure 7-3
Creating a Greenbar Matrix
The pattern used for a matrix is very similar to a table. Since the matrix generates column cells dynami-
cally, there is no way to specify a different expression for each column. If I wanted the row header to
have an alternating background color, I could use the same technique as the table: toggling the odd/
even flag explicitly on the row header text box. But, if the pivot cell is to be the leftmost item with an
alternate background color on each row, this becomes more challenging. To work around this limitation,
I define an extra row group on the same field expression as the previous group in the row hierarchy.
Figure 7-4 shows the group definitions. The two row groups both use the same expression. This will
cause the second group header text box to be repeated with each row. I'm going to hide this cell when
I'm done.
Next, I set the BackgroundColor property using the same expression that I used in the table example.
The second row header text box sets the AlternateColor function to toggle the odd and even rows.
Since the pivot cell (the text box at the intersection of the row groups and column group) is repeated
with the same background color for every column in a row, the second function argument is set to False
(see Figure 7-5).
Search WWH ::




Custom Search