How to read the current configuration(such as rows,columns,filters,measures etc) that are available in the PivotView Control using the ASP.NET MVC 4 Helper APIs. I am looking to read/write these configurations from/to database.
I tried the below and it does seem to work. Please advice
Code & Screenshot attached below
Added a button on the view to post. Here is the View code
@using Infragistics.Web.Mvc@model Infragistics.Web.Mvc.PivotViewModel
@using (Html.BeginForm("PivotView","Home",FormMethod.Post)){ <input type="submit" value="Read" />
@(Html.Infragistics().PivotView() .DataSourceOptions( dataSourceOptions => dataSourceOptions .Columns("[Product].[Product Categories]") .Rows("[Sales Territory].[Sales Territory]") .Measures("[Measures].[Internet Order Count]") .XmlaOptions( xmlaOptions => xmlaOptions .ServerUrl("http://sampledata.infragistics.com/olap/msmdpump.dll") .Catalog("Adventure Works DW Standard Edition") .Cube("Adventure Works") .MeasureGroup("Internet Sales"))).ID("pivotView") .Render())}
On the controller, the values for rows,columns,filters,measures etc all appear as 'null'
Can I get a quick response for this query please?.
Hi Satish,
I don't think that the model in your action in the controller is the same as the one from the View.
What is possible to achieve is to configure the PivotViewModel in the controller and pass it to the View. Then in the view you can use this model in the MVC helper initialization.
In the View:
@(Html.Infragistics().PivotView(Model))
In the Controller:
public ActionResult PivotView(PivotViewModel model) { model.DataSourceOptions = new DataSourceOptions { Columns = "[Product].[Product Categories]", Rows = "[Sales Territory].[Sales Territory]", Measures = "[Measures].[Internet Order Count]", XmlaOptions = new XmlaOptions { ServerUrl = "http://sampledata.infragistics.com/olap/msmdpump.dll", Catalog = "Adventure Works DW Standard Edition", Cube = "Adventure Works", MeasureGroup = "Internet Sales" } }; return View(model); }
Hope this helps.
Thanks,
Diyan