How is the syntax in C # for this code?
<olap:XmlaDataSource x:Key="DataSource" ServerUri="">sampledata.infragistics.com/.../msmdpump.dll" Database="Adventure Works DW Standard Edition" Cube="Adventure Works" Filters="[Sales Territory].[Sales Territory Country]{[Sales Territory].[Sales Territory Country].&[United Kingdom]}" Columns="[Date].[Calendar]" Rows="[Geography].[City]" Measures="Reseller Sales Amount" />
Please Help me, thanks!
Thank you. I see the syntax. I'm sticking with the XAML, but I'll switch to the code behind later when my custom controls are hooked up.
This is something that I've tried, but when I execute this restriction the AdomdDataProvider (using the Infragistics sample) throws a Null Reference exception when creating the AsyncCompletedEventArgs() in the Completed event. I'm not using the msmdpump.dll. I hope I can get this working. I'm SO close and yet the code provided by Infragistics is throwing that NullReference exception.
The provider works fine when there is no restriction (just the dimension, and handles a second one using a comma), but once I add that restriction it blows up with the NullReference in the call back for the DimensionGroups in the AdomdDataProvider code. I'm in the debugger and as far as I can tell it's in the constructor because all the other variables are NOT null. Something in the cube structure is null that is causing this exception.
OnLoadMeasureGroupDimensionsCompleted(
new AsyncCompletedEventArgs(e.Error, e.Cancelled, cube));
Hi,
Here are the XAML and code behind syntaxes:
[Code behind]xmlaDataSource.Filters = DataSourceBase.GenerateInitialItems("[Product].[Sub Category Name]{[Product].[Sub Category Name].&[Segment 1]}");[XAML]Filters="[Product].[Sub Category Name]{[Product].[Sub Category Name].&[Segment 1]}"
When the grid is loaded the Product hierarchy should appear in the filter area and in the hierarchy filter tree you have to see that just “Segment 1” member is checked.
Regards.
Plamen.
HI
try to replace .& with & only. there is a syntax error in the post. the right syntax should be
Filters="[Product].[Sub Category Name]{[Product].[Sub Category Name].&[Segment 1]}"
Todor
I'm specifically looking at Filters in this post. Is that the correct syntax? I'm using the following:
Filters
="[Product].[Sub Category Name]{[Product].[Sub Category Name].&[Segment 1]}"
I would expect the pivot data to be filtered by [Product].[Sub Category Name] whose value is "Segment 1". I get data back, but it's not filtered and the filter control on the xamPivotGrid is not changed either. And what if I also wanted "Segment 2". I don't see any examples as to the syntax on the XmlaDataSource reference page.
Thanks.
Hi
the code behind is like bellow:
XmlaDataSource xmlaDataSource = new XmlaDataSource();
xmlaDataSource.ServerUri = new Uri("http://sampledata.infragistics.com/olap/msmdpump.dll");
xmlaDataSource.Database = XmlaDataSource.GenerateInitialDatabase("Adventure Works DW 2008");
xmlaDataSource.Cube = DataSourceBase.GenerateInitialCube("Adventure Works");
xmlaDataSource.Columns = DataSourceBase.GenerateInitialItems("[Date].[Calendar]");
xmlaDataSource.Rows = DataSourceBase.GenerateInitialItems("[Geography].[City]");
xmlaDataSource.Filters = DataSourceBase.GenerateInitialItems("[Sales Territory].[Sales Territory Country]{[Sales Territory].[Sales Territory Country].&[United Kingdom]}");
xmlaDataSource.Measures = DataSourceBase.GenerateInitialItems("Reseller Sales Amount");
pivotGrid.DataSource = xmlaDataSource;
Regards