How do I specify specific number of columns in a report

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

Foreman1
Job No1
Emp1 Emp2 Emp3 Emp4
Emp5 Emp6

Foreman1
Job No2
Emp1 Emp2 Emp3 Emp4

Foreman2
Job No1
Emp1 Emp2 Emp3 Emp4
Emp5 Emp6

etc....

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.
CraigbobAsked:
Who is Participating?
 
ValentinoVBI ConsultantCommented:
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)
0
 
ValentinoVBI ConsultantCommented:
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 *
	, (ROW_NUMBER() OVER (
		PARTITION BY dp.Color
		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.
Report6.rdl
0
 
CraigbobAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.