We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to load the OlapChart control dynamically from a UserControl

This can be achieved by adding the OlapChart in a separate user control. The procedure to bind the data to OlapChart is, First the OlapChart’s framework must be loaded with applied templates and then the OlapDatamanager should set and bind the data. So while you add the OlapChart dynamically from the Usercontrol, we have to set the OlapDataManager in the Loaded event of OlapChart (i.e., After the OlapChart is initialized).

Please find the code snippet as below.

 

public MainPage()

{

InitializeComponent();

InitializeConnection();

SilverlightControl1.MyOlapChart.Loaded += new RoutedEventHandler(MyOlapChart_Loaded);

string MdxString = " SELECT NONEMPTY({[Measures].[Internet Sales Amount]}) dimension properties member_type, PARENT_UNIQUE_NAME ON COLUMNS , NONEMPTY( VISUALTOTALS( ({{Drilldownlevel({ [Date].[Fiscal] })}}) ),{[Measures].[Internet Sales Amount]}) dimension properties member_type, PARENT_UNIQUE_NAME ON ROWS FROM [Adventure Works] CELL PROPERTIES VALUE, FORMAT_STRING, FORMATTED_VALUE";

this.DataManager = new OlapDataManager();

this.DataManager.DataProvider = dataProvider;

this.DataManager.MdxQuery = MdxString;

}

void MyOlapChart_Loaded(object sender, RoutedEventArgs e)

{

SilverlightControl1.MyOlapChart.OlapDataManager = this.DataManager;

}

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
2777 11/21/2014 11/25/2014 Silverlight OlapClient
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.