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
but we want see multi-column report like this
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.
2. Put a Matrix on report like this (Matrix is in {ToolBox} under {Report Items}).
In bottom we see [RowGroup] under Row Groups and [ColumnGroup] under Column Groups.
3. RightClick on [RowGroup] and click Group Properties.
4.Click {Fx} to appear Expression window then insert this expression in top textbox
=ceiling(rownumber(nothing
) / 3)
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}
It will be open a new window. we fill combobox with field [No] which has been defined in Table1.
Click OK.
7.Now click preview to see
8.If we have more than one field in table we can use {InsertGroupRight}
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.
Comments (6)
Author
Commented:Thank you for the tips.
Commented:
Commented:
Commented:
Commented:
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