XmlaDataProvider

2 posts, 1 answers
  1. David
    David avatar
    4 posts
    Member since:
    May 2012

    Posted 29 Jan 2013 Link to this post

    Hi,

    Your online demo http://demos.telerik.com/silverlight/#PivotGrid/OlapKpis is wonderful.  However, when i migrate the code from xaml to cs, it does not work.  Is there anything i missed?

    XmlaDataProvider provider = new XmlaDataProvider();
     
    XmlaConnectionSettings settings = new XmlaConnectionSettings();
     
    settings.Cube = "Adventure Works";
    settings.Database = "Adventure Works DW 2008R2";
    settings.ServerAddress = @"http://demos.telerik.com/olap/msmdpump.dll";
     
    provider.ConnectionSettings = settings;
    provider.AggregatesPosition = PivotAxis.Rows;
     
    provider.RowGroupDescriptions.Add(new XmlaGroupDescription() { MemberName = "[Product].[Category]" });
    provider.ColumnGroupDescriptions.Add(new XmlaGroupDescription() { MemberName = "[Date].[Fiscal Year]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Sales Amount]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Revenue Goal]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Revenue Status]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Revenue Trend]" });
     
    RadPivotGrid pivot = new RadPivotGrid();
    pivot.DataProvider = provider;

    Thanks
  2. Answer
    Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 29 Jan 2013 Link to this post

    Hi David,

    You should call Refresh method of your DataProvider to show the data in RadPivotGrid. The other (and preferred way when you initialize your DataProvider) is to call BeginInit and EndInit methods so all of your changes will apply together:
    provider.BeginInit();
    provider.ConnectionSettings = settings;
    provider.AggregatesPosition = PivotAxis.Rows;
     
    provider.RowGroupDescriptions.Add(new XmlaGroupDescription() { MemberName = "[Product].[Category]" });
    provider.ColumnGroupDescriptions.Add(new XmlaGroupDescription() { MemberName = "[Date].[Fiscal Year]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Sales Amount]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Revenue Goal]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Revenue Status]" });
    provider.AggregateDescriptions.Add(new XmlaAggregateDescription() { MemberName = "[Measures].[Internet Revenue Trend]" });
     
    provider.EndInit();

    Thank you for choosing RadPivotGrid. Do not hesitate to contact us if you have any problems or concerns.

    Regards,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top