Hi;
I use an XamPivotGrid and send its Query from another page. When I try to XML Query to Deserialize and fetch data to pivot grid, I could use the following code.
pivotGrid.DataSource.Cube = pivotGrid.DataSource.Cubes[this.SelectedCubeIndex]
But pivotGrid.DataSource does not have any Cubes. I could not load any Cubes to dataSource.
Here is connection codes are like :
XmlaConnectionSettings Settings = new XmlaConnectionSettings(); Settings.ServerUri = new Uri("http://server/OLAP/msmdpump.dll"); XmlaConnection Connection = new XmlaConnection(Settings); XmlaDataProvider DataProvider = new XmlaDataProvider(Connection); XmlaDataSource DataSource = new XmlaDataSource(DataProvider); DataSource.Database = XmlaDataSource.GenerateInitialDatabase("DataBaseName"); DataSource.LoadSchemaAsync();
Hello,
Once you call LoadSchemaAsync() for your target data source (the one you want to pick up a cube for) you can listen for LoadCubesCompleted event and check event args for the result or for the error. If the cubes are loaded successfuly at this point you also can check the Cubes collection which should contain your cubes.
Regards.Plamen.
Hi ,
I am trying to fetch data from a OLAP cube using XmlaDataSource. But when i look at the Cubes it doesn't show any Cubes. Below is the code.
XmlaNetworkCredential Credentials = new XmlaNetworkCredential();
Credentials.Domain = "Domain"; Credentials.UserName = "UserName"; Credentials.Password = "Password";
XmlaConnectionSettings Settings = new XmlaConnectionSettings(); // Settings.Credentials = Credentials; Settings.ServerUri = new Uri("http://server/olap/msmdpump.dll"); XmlaConnection Connection = new XmlaConnection(Settings); XmlaDataProvider DataProvider = new XmlaDataProvider(Connection); XmlaDataSource DataSource = new XmlaDataSource(DataProvider);
DataSource.Credentials = Credentials;
DataSource.LoadSchemaAsync();
Am i missing anything here. Can someone please help.
Regards,
Yohan
Hello Yohan,
You can see the sample from the Samples Browser under xamPivotGrid / Data / XMLA Authentication section, where it is shown how to use XmlaDataSource.