SSRS Rotate Column

I current has this report layout

<B> ProductNumber Description PackType Dimension Weight
PN 1 Desc PN1 InnerPack 1x1x1 1
PN 1 Desc PN1 SinglePack 1x1x1.2 1.2
PN 2 Desc PN2 InnerPack 2x2x2 2
PN 2 Desc PN2 SinglePack 2x2.2x2.2 2.3
PN 3 Desc PN3 BulkPack 3x3x3 3

Now my users want to turn this way

<b> InnerPack SinglePack BulkPack
<B> ProductNumber Description Dimension Weight Dimension Weight Dimension Weight
PN 1 Desc PN1 1x1x1 1 1x1x1.2 1.2                                   
PN 2 Desc PN2 2x2x2 2 2x2.2x2.2 2.3                                   
PN 3 Desc PN3                                                                 3x3x3 3

How can I do that? I am using MS VS2008.

thanks

TL

PS Thanks to ManisHearth for giving me an idea on how to create a table in a post.

+7
source share
1 answer

You can do this with the standard Matrix . Create matrix and add a row group based on ProductNumber and a Column Group based on PackType. I also added a couple more rows to the matrix to get more details in the header. I needed to split the column header cells to add size and weight headers.

Add the part values โ€‹โ€‹to the Matrix body - I deleted the automatic Sum that was added to the Weight value, but this is not strictly necessary. In the designer, it should look something like this:

enter image description here

Another thing to consider; your PackType groups are not in alphabetical order, so I updated the Column Group sort expression for the order I wanted. I used:

=Switch(Fields!PackType.Value = "InnerPack", 1 , Fields!PackType.Value = "SinglePack", 2 , Fields!PackType.Value = "BulkPack", 3) 

The end result that meets your requirements:

enter image description here

+12
source

All Articles