Hello,
I am trying to use a simple DataTable or an XML file (generated by another application) as a FlatDataSource for the xamPivotGrid. This should be easy I assume but I do not manage to have it work.
Using the following code doesn not make it (dt is my DataTable)
FlatDataSource flatDataSource = new FlatDataSource()
{
ItemsSource = dt.AsEnumerable().ToList()
Measures = XmlaDataSource.GenerateInitialItems("AmountOfSale")*/
};
I want something very simple to plug any Table to the xamPivotGrid. I cannot define a priori a class to serialize the dataTable (or XML file) so it is not so obivious to create the IEnumerable. Thanks for your help.
Hi Philip,
Thanks a ton. It got worked after doing the modification you suggested.
Regards,
Narasimhan.
Hello, Narasimhan!
In the code behind (MainWindow.xaml.vb) you need to change the
EntriesLevel.LevelExpressionPath = ""
with
EntriesLevel.LevelExpressionPath = Column.ColumnName
Let me know if this fixes your issue.
Philip
Hi Todor,
First of all sorry for replying the older thread. I have gone through the sample project attached by you.
I have upgraded that project for 13.1 version. My problem here is after i drag drop a field from Data selector to Pivot Grid (either in Column or Row) and when i expand the field in pivot grid, it show the Cube name instead of its detail values.
Kindly help me.
Thanks in advance,
I figured it out thanks.
IEnumerator enumerator = flatDataSource.ItemsSource.GetEnumerator(); while (enumerator.MoveNext()) { Type type = enumerator.Current.GetType(); PropertyInfo pi = type.GetProperty("Index Name"));
... // Now I can get and set the values
}
Hi,
I am using XamPivotGrid. I want to edit a rows/columns in the PivotGrid. Instead of doing it via the grid, I want to modify the data source.
I use FlatDataSource as above. How ca I retrieve and edit FlatDataSource.itemSource dynamically.
Thanks