setPivotSortItems(report: PP.Exp.EaxDocument, metadata: Object, callback: PP.Delegate);
report. Express report document.
metadata. Metadata containing information about sorted elements of express report table.
callback. Callback function for getting report metadata.
The setPivotSortItems method creates parameters for rule action area of express report table sorting.
To execute the example:
Create an HTML page.
Add the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component).
Go to table of express report.
Click the Add button in sorting rules of table.
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: