EaxMdService.setPivotDims

Syntax

setPivotDims(report: PP.Exp.EaxDocument, ownerDimsMetadata: Object, callback: PP.Delegate);

Parameters

report. Express report document.

ownerDimsMetadata. Metadata that contains information on dimensions and their positions.

callback. Callback function that gets report metadata.

Description

The setPivotDims method sets new position of dimensions in express report table.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component) and have a loaded table in working area of the express report. Data source must contain dimensions with the keys 98, 103, 104, 105 and 106. One of these dimensions must be shown in columns, for example, the Calendar dimension with the 106 key (the figure below shows the 2005 element):

Change position of the Calendar dimension to table rows:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get properties panel
var dimBar = expressBox.getPropertyBarView().getDimBarViewPanel();
// Display panel
dimBar.show();
// Expand panel
dimBar.expand(True);
// Determine metadata
var metadata = {
    dims: {
        its: {
            it: [{
                "k": 105, // The Territories dimension
                "position": "Left"
            }, {
                "k": 106, // The Calendar dimension
                "position": "Left" 
            }, {
                "k": 98, // The Facts dimension
                "position": "Top"
            }, {
                "k": 103,
                "position": "Fixed"
            }, {
                "k": 104,
                "position": "Fixed"
            }]
        }
    }
};
var metadataForService = new PP.Mb.Ui.PropertyChangedEventArgs({
    PropertyName: PP.Exp.Ui.ControlType.DimOrder,
    Metadata: metadata,
    TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.DataView, PP.Exp.Ui.ViewTypeUpdate.Ribbon, 
        PP.Exp.Ui.ViewTypeUpdate.PropertyBar] }); // Define the callback function var onPivotDimsConfirm = function (sender, args) {     expressBox.getDataView().getMapView().MetadataChanged.fire(this, args.Args);     expressBox.refreshAll() }; // Set a new format eaxMdService.setPivotDims(expressBox.getSource(), metadata,
    PP.Delegate(onPivotDimsConfirm, this, metadataForService));

After executing the example the Calendar dimension is shown in table rows:

See also:

EaxMdService