TOLAPAnalysis understanding
Posted by Vladimir Lyutetsky on 22 September 2014 12:08 PM

Radar-Soft brings new control to display OLAP data - TOLAPAnalysis. This controls allows to combine the grid view and chart view of the data. All properties are practically the same as for TOLAPGrid and TOLAPChart. The control can be used in runtime as well as in design-time. To switch the display mode you can use the UI or the property named AnalysisType.

 

analysis.AnalysisType = AnalysisType.Chart; // set chart 

analysis.AnalysisType = AnalysisType.Grid;  // set grid view

 

or using UI:

Button for switch analysis type

Button for switch analysis type

 

Menu for switch analysis type

Menu for switch analysis type

 

Additional capabilities on AnalysisType changing

 

When changing the AnalysisType property some other TOLAPAnalysis properties are automatically changed as well:

 


Changing to OLAPChart

Changing to OLAPGrid

Measures

The visible measures are moved to different MeasureGroup (analysis.AxesLayout.YAxis collections).

The measures are deleted from the analysis.AxesLayout.YAxis collection and become visible (Visible==true).

Hierarchies

Are not changed

Are not changed

Hierarchy levels

Are not changed

The continuous order of visibility is set inside every hierarchy*

 

*When TOLAPAnalysis.AnalysisType == AnalysisType.Chart the values of levels visibility can be rotated (f.e. "Time" hierarchy levels of "year", "quarter", "day" are visible but "month" level is hidden). When TOLAPAnalysis.AnalysisType == AnalysisType.Grid this feature is disabled. During transition to the AnalysisType.Grid, the continuity of visibility levels is set automatically.

 

You can interfere and do something when the AnalysisType property is changed in the AnalysisTypeChanging and AnalysisTypeChanged events. TOLAPAnalysis.AnalysisTypeChanging is fired before the property AnalysisType is actually changed. In the handler for the event you can execute the commands and\or replace the mechanism of transition from the grid in the chart and back:

 

// Canceling the automatic switch of the control mode

void Grid_AnalysisTypeChanging(object sender, AnalysisTypeChangingHandlerArgs e)

{

    e.AnalysisTypeMethod = AnalysisTypeMethod.Custom;

    // place any custom code 

}

 

TOLAPAnalysis.AnalysisTypeChanged is fired after the property AnalysisType, so you can write any reaction code here:

void Grid_AnalysisTypeChanged(object sender, AnalysisTypeChangedHandlerArgs e)

{

    // place any custom code 

}

 

 

Backward compatibility of TOLAPAnalysis

 

TOLAPGrid and TOLAPChart controls are now heirs of TOLAPAnalysis. TOLAPAnalysis combines the API of these two controls so the old projects are expected to work without any changes at all. However the controls will be able to switch the AnalysisType and that can be used in the old projects if needed. In the new projects we recommend to always use TOLAPAnalysis.

 

The button switching the AnalysisType may be hidden if needed:

 

// init code

analysis.AnalysisType = AnalysisType.Grid; 

Grid.ShowToolboxButton += Grid_ShowToolboxButton;

 

// event handler

void Grid_ShowToolboxButton(object sender, ShowToolboxButtonEventArgs e)

        {

            if (e.ItemType == ToolboxButtons.AnalysisGroup)

                e.Item.Visible = false;

        }

(0 vote(s))
This article was helpful
This article was not helpful

Help Desk Software by Kayako Resolve