Simple way to show multi column data in SSRS (Horizontally or Vertically)

rshqProgrammer
CERTIFIED EXPERT
Published:
Updated:
Hi
When we create a simple report in SSRS data show in one column. (To start using SSRS see this link Creating a Report Server Project ).

In this article we want create a report to show data in multi-column (Horizontally or Vertically).
For example: if we have one table with name [Table1] and one field  [No] and inserted number from 1 to 100  in this  table.

If we create a simple report in SSRS and show data on it
we see this report

P1
but we want see multi-column  report like this

P2
How can we do that?
1. We create a report using BIDS (used in this article ) or other tools  
after that  delete all object on it to see this picture.

P3
 2.  Put a Matrix on report like this (Matrix is in {ToolBox} under {Report Items}).

P4
In bottom we see [RowGroup] under Row Groups and [ColumnGroup] under Column Groups.
3. RightClick on  [RowGroup] and click Group Properties.
P5
4.Click {Fx} to appear Expression window then insert this expression in top textbox

=ceiling(rownumber(nothing) / 3)

P6

Then click two OK.

5.  Do  stage 3 to 4 for  [ColumnGroup]  but only in expression window type this

=ceiling(rownumber(nothing) mod 3)

Then click two OK.

Number 3 in above formulas show count of column in report result.If we need more column can change it in  above formulas.

6.Now RightClick on Data part of Matrix and select {TextBox Properties}

P7
 It will be open a new window. we fill combobox with field [No] which has been defined in Table1.

P8
Click OK.
7.Now click preview to see

P9
8.If we have more than one field in table we can use {InsertGroupRight}

P10  
 
9.If we want show result vertically swap two formulas together.(In stage 4 use this formula
=ceiling(rownumber(nothing) mod 3) and in stage 5 use this =ceiling(rownumber(nothing) / 3) )

Thanks
I hope this article be useful.
7
20,487 Views
rshqProgrammer
CERTIFIED EXPERT

Comments (6)

rshqProgrammer
CERTIFIED EXPERT

Author

Commented:
Hi
 Thank you for the tips.
Jim HornSQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015

Commented:
Nicely done with the images.  Voted Yes.

Commented:
The reversing of the 2 formulas does not work. It gives 3 rows of data and several columns. How would I force it to give me 8 columns where the data flows down instead of across?
Thank you. Works great.
Rog DSQL Developer / Web Development / Business Analysis
CERTIFIED EXPERT

Commented:
Was curious as this works well in the Preview mode, but no so good in the rendering in SSRS.  

I mean the columns work, but not the sorting order.  Any help with this?

I sorted the data coming from the dataset, but that order is great in the preview screen, but
is now handled the same on the SSRS rendering.

Rog

View More

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.