BIRT Data Analyzer and cross tabs : Controlling the Data Analyzer viewer User Interface

Controlling the Data Analyzer viewer User Interface

Show or hide Data Analyzer viewer features with the actuate.xtabanalyzer.UIOptions class. The UIOptions class includes functions that support the ability to hide or show different features of the viewer. Figure 3-4 shows what functions affect the viewer display.

Figure 3-4  Data Analyzer viewer showing areas altered with UIOptions

Pass true or false values to the UIOptions functions to display or hide the portion of the viewer that is associated with that particular function, as shown in the following code:

var uiOptions = new actuate.xtabanalyzer.UIOptions( );
uiOptions.enableToolbar(false);
uiOptions.enableCubeView(false);
uiOptions.enableCrosstabView(false);
 
// ctViewer is an instance of the XTabAnalyzer class.
ctViewer.setUIOptions( uiOptions );

This code produces a viewer similar to Figure 3-5.

Figure 3-5  Data Analyzer viewer with settable UIOptions off

In addition to the UIOption class, some details shown within the viewer can be hidden with Crosstab.showDetail( ) and Crosstab.hideDetail( ).

For example, the cross tab in Figure 3-5 has a SalesDate dimension consisting of three levels: year, quarter, and month. The following code hides the detail from the quarter level of the dimension. In this example, crosstab is an actuate.xtabanalyzer.Crosstab object:

crosstab.hideDetail("SalesDate/quarter");
crosstab.submit( );

The code in this example modifies the cross tab so it longer shows the month detail level, as shown in Figure 3-6.

Figure 3-6  Cross tab with level detail hidden

To display the detail again, use showDetail( ):

var axisType = actuate.xtabanalyzer.Dimension.ROW_AXIS_TYPE;
crosstab.showDetail(axisType,"SalesDate/quarter");
crosstab.submit( );

 


(c) Copyright Actuate Corporation 2011