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;
I download your source code and debug my simply app.
And i determinate that some problem may be on lock on private method OnMeasuresCollectionChanged()
Project Olap.WPF directory ViewModel File DataSourceBase line 5095.
On this lock my simple app freeze.
First call of this method jump to line 5091 (return) seccond call too and third call freeze on this lock.
may be one usefull information for you.
When i add only one or two Measures to Dataset
Measures="Kapacita,Prumerna obsazenost"
Everythink works ok. But when i add more then 2 mearures this simple application freeze.
I tested this on 2 others computers with windows VIsta and Xp.
I'm afraid but this still not working.
I think that is some bug dependent my data.
I try this very simple app with only XAML code and not working and still Freeze.
<Grid>
<Grid.Resources>
<olap:XmlaDataSource x:Key="myDataSource"
ServerUri="http://server/olap/msmdpump.dll"
Database="AS_Olap"
Cube="Hotel Denni Ceny"
Columns="[Time Pobytu].[Year - Quarter - Month - Date]"
Filters="[Typ Rezervace].[Typ Rezervace]{[Typ Rezervace].[Typ Rezervace].&[1]}"
Measures="Kapacita,Prumerna obsazenost,Denni Cena Celkem Se Slevou,Prumerna cena,RefPar,Prodano Pokoj Noci"
Rows="[Hotel Typ Pokoje Kontingent].[Hierarchy]{[Hotel Typ Pokoje Kontingent].[Hierarchy].[Druh Hotel].&[1]}"
/>
</Grid.Resources>
<StackPanel>
<ig:XamPivotGrid x:Name="xamPivotGrid1" DataSource="{StaticResource myDataSource}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" AllowCompactLayout="True" Foreground="Black" />
</StackPanel>
</Grid>
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.