mikey
mikey

Reputation: 5160

SSRS Conditional Formatting

I have a simple List in my report, with a single row and a single column (which is repeated depending on the number of items returned by the query).

What I'd like to do is this: Inside the cell (in the same location), display one rectangle full of items (text boxes, images, etc) for even rows, and another (with different items) for odd rows.

What is the recommended way to accomplish this?

Upvotes: 0

Views: 140

Answers (1)

Ian Preston
Ian Preston

Reputation: 39586

I would use something like this for the Hidden property of the Rectangles:

=IIf(RowNumber(Nothing) Mod 2 = 0, true, false)

Use a different order for true / false for each of the two Rectangles to get them to alternate.

All the expression is doing is checking if a row number is even and setting the visibility based on this.

This is a pretty standard SSRS pattern which is typically used for alternating row colours, but it should work the same for showing/hiding items.

Upvotes: 1

Related Questions