Hi,
I've just started using the xamlPivotGrid and the adomdDatasource and I can configure the datasource correctly in xaml but if I try to create it in code I ran into some trouble. I couldn't find a code sample (only zaml) that shows how to configure the datasource in the code -behind. Do you have one that I could modify and add in my application?
I need one that will connect to an olap cube and preset a query (measures, columns and rows)
Thanks.
Hi Thank you for your reply that worked great.
You can use the sample below
AdomdConnectionSettings connectionSettings = new AdomdConnectionSettings();
connectionSettings.ConnectionString = "Provider=MSOLAP.3;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=Adventure Works DW 2008;Data Source=local;MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error";
AdomdDataSource xmlaDataSource = new AdomdDataSource(xmlaDataProvider)
{
ConnectionSettings= connectionSettings,
Database = DataSourceBase.GenerateInitialDatabase("Adventure Works DW 2008"),
Cube = DataSourceBase.GenerateInitialCube("Adventure Works"),
Columns = DataSourceBase.GenerateInitialItems("[Columns]"),
Rows = DataSourceBase.GenerateInitialItems("[Products],[Drivers]"),
Measures = DataSourceBase.GenerateInitialItems("Value1,Value2,ROI")
};
Regards
Todor