Reputation: 1355
I have a normal report like the below one,
Animal
Dog
Cat
Elephant
Tiger
Lion
Man
Panda
Which i want to do a break after n number of columns.
Animal Animal
Dog Cat
Elephant Tiger
Lion Man
Panda
I tried the page break which breaks into a new page. Did some grouping etc.. still didn't work out. Is there a way in SSRS to work this out. I know how to do it via SQL, iam asking about doing it via SSRS.
Edit: I have used the below query in SSRS.
SELECT 610 AS [Period],1 AS RowNumber
UNION
select 611, 2
UNION
select 612, 3
UNION
select 613, 4
UNION
select 614, 5
UNION
select 615, 6
UNION
select 616, 7
UNION
select 617, 8
I added a new Matrix table, then i added 'Period' field to the matrix table (Screenshot Num 1). In the column grouping expression. i have used the below expressions. One at a time
=Floor(Fields!RowNumber.Value / 3) and =Fields!RowNumber.Value Mod 3
but now it shows only 3 columns now.
What i have expected to see is (Screenshot Num 3) and what iam getting is (Screenshot Num 2).
Upvotes: 2
Views: 124
Reputation: 6034
You can't use SSRS aggregate functions like RowNumber
in grouping expressions or dataset calculated fields. So you would need to add a number to your rows in the SQL. I would recommend using ROW_NUMBER
for this. You could also use a RANK
function. You don't have to partition by anything, just give it something to sort by and you're good to go.
Then in the report, you can use a column grouping expression like this to get 5 rows per column:
=Floor(Fields!RowNumber.Value / 5)
To use a specific number of columns you could use an expression like this:
=Fields!RowNumber.Value Mod 5
Upvotes: 1