EaxMdService.setPivotSortItems

Syntax

setPivotSortItems(report: PP.Exp.EaxDocument, metadata: Object, callback: PP.Delegate);

Parameters

report. Express report document.

metadata. Metadata containing information about sorted elements of express report table.

callback. Callback function for getting report metadata.

Description

The setPivotSortItems method creates parameters for rule action area of express report table sorting.

Example

To execute the example:

  1. Create an HTML page.

  2. Add the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component).

  3. Go to table of express report.

  4. Click the Add button in sorting rules of table.

  5. In the console, set parameters for rule action area:

var dataView = expressBox.getDataView();
var service = dataView.getService();
// Get express report document
var report = expressBox.getSource();
// Set table sorting parameters by the second column and in ascending order
var metadata = {
    "method":"Set",
    "rules": [{
        key: 21, 
        index: 2, 
        kind: "Column", 
        direction: "Asc"
        }]
};
var callback = function (sender, args) {        
    // Refresh express report
    expressBox.refreshAll();
};
// Apply sorting parameters
service.setPivotSortItems(report, metadata, callback);

After executing the example the express report table is sorted by the second column and in ascending order.

See also:

EaxMdService