Tuesday 25 June 2013

Show Multi Column Data in SSRS/ Show single column into multiple column based on space of page


Problem Description:
Suppose our SSRS Report have layout such as following:

Field_Title
1
2
3
4
5
6
7
8

[Above tablex has only single column but multiple rows]



Now someone may be looking the date to be displayed as under to save space

1
2
3
4
5
6
7
8


[This sort of layout may be needed to save space]
How to achieve this is SSRS let’s talk about this.


Solution:
Before discussing solution let’s see how our data is in a very basic report with single column
See the image as under:
 



As you can see data is just being displayed in sequential manner as its coming from DS and in current situation this column will keep on growing until next pages, while skipping space at the right side which we want to consume



      Step-1

Drag a matrix in the report design as shown under

Step -1: adding an Matrix



      Step-2

Click on Row groups >> Group Properties as shown below: 



      Step-3

As you will click the Row Group properties, you will see a prompt as under:

                                 
                 Step-4
Click on button FX, which is used to enter expressions and eneter following expression:
=ceiling(rownumber(nothing)/3)






      Step-5

Next Click the column group >> Group Properties
Remember column group is also located at the same place where the row group is that down to design but on right side.
now by chosing properties of column group add the following expression
=ceiling(rownumber(nothing)mod 3)




       Step-6

Now select you data field as shown below


 As the field taken into example is integer type so by defult ssrs will bring it as sum so right the field and chage it from some to field, in you case it may not happen if the field is of string or any other data type like date. so the following step is needed only when the case is that our field id of integer or real type. in other types like string date etc the following step may not be needed.


   next delet the left colum and save report [Remeber to delete only column do not delet group it will give two choice select field only , keep group]



Save and preview report






3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. i tried this but i got an error: A group expression for the grouping 'ColumnGroup' uses the RowNumber function with a scope parameter that is not valid. When used in a group expression, the value of the scope parameter of RowNumber must equal the name of the group directly containing the current group

    ReplyDelete
  3. It's working perfectly in AX Dynamics 2012.
    Thank You!

    ReplyDelete