Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

SSRS report like Excel Pivot

$
0
0

Hi friends,

I want to create a report something similar like excel pivot

The report at first sight should show me like this:

Row Labels Sum of COL1 Sum of COL2 Sum of COL3 Sum of COL4 Sum of COL5
+101 11 14 10 19 10
+102 3 6 9 12 15
+103 4 8 12 16 20
+104 3 6 9 12 15
Grand Total 21 34 40 59 60

When I click on (+) toggle the report should give me detailed data like this:

  Values    
Row Labels Sum of COL1 Sum of COL2 Sum of COL3 Sum of COL4 Sum of COL5
101     
A12345
B32470
C68040
D12345
102     
A12345
B12345
C12345
103     
A12345
B12345
C12345
D12345
104     
A12345
B12345
C12345
Grand Total 21 34 40 59 60

Below is the sample data:


CREATE TABLE [dbo].[SampleTable](
[ID] [int] NULL,
[COL0] [nvarchar](50) NULL,
[COL1] [int] NULL,
[COL2] [int] NULL,
[COL3] [int] NULL,
[COL4] [int] NULL,
[COL5] [int] NULL
) ON [PRIMARY]
GO
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (101, N'A', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (101, N'B', 3, 2, 4, 7, 0)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (101, N'C', 6, 8, 0, 4, 0)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (102, N'A', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (102, N'B', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (102, N'C', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (103, N'A', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (103, N'B', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (103, N'C', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (103, N'D', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (104, N'A', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (104, N'B', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (104, N'C', 1, 2, 3, 4, 5)
INSERT [dbo].[SampleTable] ([ID], [COL0], [COL1], [COL2], [COL3], [COL4], [COL5]) VALUES (101, N'D', 1, 2, 3, 4, 5)


Please Mark as Answer if my post solved your problem or Vote As Helpful if this helps. Blogs: www.sqlserver2005forum.blogspot.com


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>