Beispiel #1
0
 public ActionResult Index(IndexViewModel model)
 {
     model.pivot = SampleDB.Data.ToPivotTable(
         PivotColumn <MockData> .Build("country", "gender"),
         PivotColumn <MockData> .Build("stock_market"),
         PivotMeasure <MockData> .Build("stock")
         );
     return(View(model));
 }
Beispiel #2
0
 public ActionResult Total(IndexViewModel model)
 {
     model.pivot = SampleDB.Data.ToPivotTable(
         PivotColumn <MockData> .Build("country", "gender"),
         PivotColumn <MockData> .Build("stock_market"),
         PivotMeasure <MockData> .Build("stock")
         );
     model.Option.Header[HeaderType.Row].RenderTotal = true;
     model.Option.HeaderCellOption[model.pivot.ColumnByName("country")].RenderTotal = true;
     return(View(model));
 }
Beispiel #3
0
 public ActionResult Measure(IndexViewModel model)
 {
     model.pivot = SampleDB.Data.ToPivotTable(
         PivotColumn <MockData> .Build("country", "gender"),
         PivotColumn <MockData> .Build("stock_market"),
         new List <PivotMeasure <MockData> >()
     {
         PivotMeasure <MockData> .Sum("Sum", (t) => t.stock),
         PivotMeasure <MockData> .Average("Avg", (t) => t.stock),
         PivotMeasure <MockData> .Min("Min", (t) => t.stock),
         PivotMeasure <MockData> .Max("Max", (t) => t.stock),
     }
         );
     return(View(model));
 }