I'm designing an SSRS badge report for Avery 5392 badge stock (6 per page) that will also print each wearer's record ID on the back of their badge.
I've set up RowNumber & RowMod columns in my SELECT statement so that I can filter into my design elements only 3 rows of data per column and control which rows go on the left or right-side report elements, respectively. I've also set up PageNumber as a possible grouping option for page breaks.
Please consider this dummy table as a proxy for the data I'm actually using:
CREATE TABLE #Badges (ID INT PRIMARY KEY, Name VARCHAR(50))
INSERT INTO #Badges VALUES
(100001, 'Anna')
, (100002, 'Bart')
, (100003, 'Cathy')
, (100004, 'Daniel')
, (100005, 'Ericka')
, (100006, 'Fred')
, (100007, 'Gwen')
, (100008, 'Harry')
, (100009, 'Idita')
, (100010, 'Joshi')
, (100011, 'Katie')
, (100012, 'Leo')
, (100013, 'Manuela')
, (100014, 'Nando')
, (100015, 'Olga')
, (100016, 'Park')
, (100017, 'Quang')
, (100018, 'Rhys')
, (100019, 'Sarina')
, (100020, 'Theo')
, (100021, 'Udeyume')
, (100022, 'Victor')
, (100023, 'Wynona')
, (100024, 'Xavier');
SELECT ((ROW_NUMBER() OVER (ORDER BY a.RowNumber) + 5) / 6) AS PageNumber
, a.*
FROM (SELECT ROW_NUMBER() OVER (ORDER BY b.Name) AS RowNumber
, ROW_NUMBER() OVER (ORDER BY b.Name) % 6 AS RowMod
, b.*
FROM #Badges AS b) AS a
DROP TABLE #Badges
I have a 4-square of separate report elements (using "Lists" at the moment) that looks a bit like this...
| List 1 | List 2 |
| List 4 | List 3 |
I need my report elements to display the first 3 rows of Name in the left column (List 1), then the next 3 rows of Name in the right column (List 2). Then, on the following page, I need to flip the Mod orientation using the same data to display the first 3 rows of ID in the right column (List 3), then the next 3 rows of ID in the left column (List 4).
Page 1 would look like this...
| Col 1 (List 1) | Col 2 (List 2) |
|---|---|
| Anna | Daniel |
| Bart | Ericka |
| Cathy | Fred |
... and page 2 would look like this...
| Col 1 (List 4) | Col 2 (List 3) |
|---|---|
| 100004 | 100001 |
| 100005 | 100002 |
| 100006 | 100003 |
Then I want to repeat that process on page 3 and so on.





