Thursday 26 February 2015

SSRS wrap/line break row and column within group

This SSRS solution is for making row/column break in grouping.

For the result we will consider following queary as an Example:

SQL Query :-

select '1' [Rank],'Product1' Product
union all
select '2','Product2'
union all
select '3','Product3'
union all
select '4','Product4'
union all
select '5','Product5'
union all
select '6','Product6'

and using above we get the result as shown below
Result :-
Rank       Products
1          Product1
2          Product2
3          Product3
4          Product4
5          Product5
6          Product6

Now in SSRS we need to show the result as shown below and for that we will use report Builder and creating new report.
So we have to create a dataset using above query and create one table as shown below:

Now add Row Group and Column Group as shown

In Row Group
1.  Go to the properties and add group expressions
2.  Add this =(Fields!Rank.Value- 1) Mod 3
In Column Group
1.  Go to properties of Column Group
2.  Add this to expression =Floor((Fields!Rank.Value - 1) / 3)

See the result as shown Below:

No comments:

Post a Comment