Question

I am trying to build a Table with the data values below each other.

Using the usual SSRS wizard, the data values are shown next to each other, making each data column wide.

Example:

Product...........1 Apr......2 Apr....3 Apr.....4 Apr

Prod 1

   Count    10    12  14    9

   Cost     3     5   6     3

   Total    30    30  84    27

Prod 2

   Count    10    12  14    9

   Cost     3     5   6     3

   Total    30    30  84    27

I managed to do this manually, by adding rows under the Product group, and manually inserting the fields. But I still need to add these into the totals columns.

Is there an easier way to do this?

Query:

SELECT

[Date]

,product_name

,COUNT(DISTINCT saleID) AS [Count Distinct_saleID]

,SUM(cost) AS Cost

FROM

SalesHistory

WHERE

[Date] >= @Date

AND [Date] <= @Date2

GROUP BY

,[Date]

,product_name

Was it helpful?

Solution

I think in your case Matrix is more appropriate control than a Table.

1.Add a Matrix to your report:

1

2.Select [Date] as a columns source:

2

3.In the right bottom area of the Design tab you will find Column Groups pane, right click on the existing group then Add Total -> After:

3

4.After some manipulations your report in design mode will look like following:

4

5.And eventualy in the preview mode:

5

Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top