Hi
Sorry for my english.
i write application with 2 adomdDataSource. When i call LoadSchemaAsync() then application freeze.
Then i try small simple application to deteminate where is a problem.
When i call LoadSchemaAsync() application freeze long time. I try right click on TaskBar on my application and than on my window an application run again! Where is a problem?
I try load datasource without colums and rows only with filters and thats work ok.
but when i add rows and columns freeze again.
Here is the source code:
private AdomdDataSource DS;
public MainWindow()
{
InitializeComponent();
FetchData();
}
public void FetchData()
this.DS = new AdomdDataSource();
this.DS.ResultChanged += new EventHandler<AsyncCompletedEventArgs>(DS_ResultChanged);
string OLAPDAtaSourceAdress = ConfigurationManager.AppSettings.Get("OLAPDAtaSourceAdress");
this.DS.ServerUri = new Uri(OLAPDAtaSourceAdress);
string OLAPDatabaze = ConfigurationManager.AppSettings.Get("OLAPDatabaze");
this.DS.Database = AdomdDataSource.GenerateInitialDatabase(OLAPDatabaze);
this.DS.Cube = DataSourceBase.GenerateInitialCube("Hotel Denni Ceny");
this.DS.Filters = DataSourceBase.GenerateInitialItems("[Typ Rezervace].[Typ Rezervace]{[Typ Rezervace].[Typ Rezervace].&[1]}");
this.DS.Columns = DataSourceBase.GenerateInitialItems("[Time Pobytu].[Year - Quarter - Month - Date]");
this.DS.Rows = DataSourceBase.GenerateInitialItems("[Hotel Typ Pokoje Kontingent].[Hierarchy]{[Hotel Typ Pokoje Kontingent].[Hierarchy].[Druh Hotel].&[1]}");
this.DS.Measures = DataSourceBase.GenerateInitialItems("Kapacita,Prumerna obsazenost,Denni Cena Celkem Se Slevou,Prumerna cena,RefPar,Prodano Pokoj Noci");
this.DS.LoadSchemaAsync();
void DS_ResultChanged(object sender, AsyncCompletedEventArgs e)
this.xamPivotGrid1.DataSource = sender as AdomdDataSource;
Hi again.
I try this simple application on version 10.3. and everything works ok!
Hello,
I have two things to mention:
1. When you have an AdomdDataSource the proper way to initialize the connection is to set the ConnectionSettings property of your data source
this.DS.ConnectionSettings = new AdomdConnectionSettings { ConnectionString = OLAPDAtaSourceAdress };
The connection string is something like this one:
string OLAPDAtaSourceAdress =
"Provider=MSOLAP.3;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=Adventure Works DW 2008 SE;Data Source=local;MDX Compatibility=1;Safety Options=2;MDX Missing Member Mode=Error";
I’m not sure about the format of the address you use
2. There is no need to listen for the AdomdDataSource.ResultChanged event and no need to call LoadSchemaAsync(). You just need to assign the data source to your pivot grid or to the selector:
this.xamPivotGrid1.DataSource = this.DS;
this.xamPivotDataSelector1.DataSource = this.DS;
// this.DS.ResultChanged += this.DataSource_ResultChanged;
// other initialization here
// ...
// this.DS.LoadSchemaAsync();
LoadSchemaAsync will be called automatically for you and the grid will display the result.
Is there any particular reason to have your code organized in the way you have it in your sample?
Please try with these changes applied and let me know if you have any other issues and questions.
Regards.
PPilev.
Hi,
I'm going to check what cause the issue and will write you back when I have any information about it.Thank you for your feedback.
Best regards.PPIlev.