How do I specify specific number of columns in a report

Posted on 2012-10-29
Last Modified: 2013-08-16
Hi All,

I've got a report that I'm building that seems straight forward but teh solution seems to be eluding me.

The report groups on 2 fields
Foreman and Job number.
I want the employees to show up underneath the two groupings in a 4 column horizontal list.

So I would have

Job No1
Emp1 Emp2 Emp3 Emp4
Emp5 Emp6

Job No2
Emp1 Emp2 Emp3 Emp4

Job No1
Emp1 Emp2 Emp3 Emp4
Emp5 Emp6


I've tried lists, tables, Matrix (This is being done in SSRS 2005 after all). All to no avail.

The best I've gotten is by using the
=Ceiling(RowNumber(Nothing)/4) grouping in a list, but then I get the Foreman and Job No. repeated for each of those.

Help Please.
Question by:Craigbob
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 37

Expert Comment

ID: 38548354
Have a look at the attached example.  It uses the AdventureWorksDW sample database available through Codeplex.
(I hope you can open it, it was created in SSRS2008R2.  If not, try installing Report Builder 3.0, downloadable for free.)

The sample displays product numbers in four columns, grouped by color.

Basically, this is what I've done.  First, the query contains an additional column to indicate the column in which the record should get displayed, DisplayColumn:

select *
		ORDER BY dp.ProductAlternateKey)+3) %4+1 
	as DisplayColumn
from dbo.DimProduct dp

Open in new window

In your case you'd need to PARTITION BY Foreman and Job, and ORDER BY Employee.

The next step is the report.  I'm using nested tables.  The main table has got a group on Color.  The Details level of the table also needs to group on color.

Then, each of the four "detail" textboxes contains another table.  This table is just one detail-level textbox (remove the header row and the two unused columns that get generated automatically when you drag a table into the cell).

Each of these inner tables has got a Filter set.  In column one, the filter is "DisplayColumn = 1".  For the other three columns, change the number to its respective column.

That's it!  Let me know if something here is unclear.

Author Comment

ID: 38551460
Thanks I'll take a look at that. I was already doing something like that in my SQL for the report. My only difference is I was partitioning by Employee Number.

However I don't have adventureworks db on my PC. I did look at the report in report builder and tried to make the modifications to get it to work in 2005 but had no luck.

I was getting multiple rows of the header (foreman) and only one employee per header.
LVL 37

Accepted Solution

ValentinoV earned 500 total points
ID: 38556327
I wrote an article based on your question.  Have a look at it for more detailed step-by-step instructions on getting a multi-column report implemented: Creating Multiple-Column Reports (SSRS)

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question