0

I have a ASP.NET MVC 4 app with an ASP.NET Web Form with a ReportViewer control. I'm using Entity Framework.

I want to display a table with Orders(id, date_add, name,quantity, price)

1 | 2011-12-08 | apples  | 4  | 0.99

2 | 2012-01-07 | oranges | 20 | 1.39

4 | 2012-03-04 | plumes  | 80 | 1.59

5 | 2012-05-01 | apples  | 15 | 0.89

6 | 2012-05-03 | pears   | 10 | 1.29

7 | 2012-05-09 | oranges | 18 | 1.49

I want my report to look like this:

December - Sum(price for dec 2011)

1 | 2011-12-08 | apples  | 4  | 0.99

2011 - Sum(price for 2011)

January - Sum(price for jan 2012)

2 | 2012-01-07 | oranges | 20 | 1.39

March - Sum(price for mar 2012)

4 | 2012-03-04 | plumes  | 80 | 1.59

May - Sum(price for may 2012)

5 | 2012-05-01 | apples  | 15 | 0.89

6 | 2012-05-03 | pears   | 10 | 1.29

7 | 2012-05-09 | oranges | 18 | 1.49

2012 - Sum(price for 2012)

How can it be done using drill-through?

And could the month be collapsed and the year visible (at first run)?

Misi
  • 748
  • 5
  • 21
  • 46

1 Answers1

0

I've made a SP where I extract the Week, Month and Year no. from the data_add field.

CREATE PROCEDURE [dbo].[Orders]         
AS
   SELECT  id_order, data_add, order_name, quantity, price, MONTH(data_add) as Mn, YEAR(data_add) as Ye, DATEPART( wk, data_add) as Week,
   FROM order
RETURN

In the report's Tablix, I've grouped 2 times( first by month, then by year).

Misi
  • 748
  • 5
  • 21
  • 46