EaxMdService.removeSheet

Syntax

removeSheet(document: PP.Exp.EaxDocument, sheetKey, callback);

Parameters

document. Document of source express report.

sheetKey. Key of the express report sheet to be removed.

callback. Callback function.

Description

The removeSheet method removes a selected express report sheet.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component) that has two sheets, and the second sheet is active:

Remove the active sheet:

// Get service to work with the express report
var eaxMdService = expressBox.getService();
// Get express report documens
var eaxDocument = expressBox.getSource();
// Get key of the active express report sheet
var sheetKey = eaxDocument.getActiveSheetKey();
var sheetName = eaxDocument.getSheetName(sheetKey);
var onSrvSheetRemove = function (n, t) {    
    var i = t.Args.IsLastTab ? t.Args.TabIndex - 1 : t.Args.TabIndex + 1;
    console.log("Name of removed sheet: " + sheetName);
    expressBox.getDataView().refresh();
};
eaxMdService.removeSheet(eaxDocument, sheetKey, PP.Delegate(onSrvSheetRemove, this, {
    RemoveSheetKey: sheetName,
    TabIndex: 2,
    IsLastTab: True
}));
// Refresh the express report
expressBox.refreshAll();

After executing the example the second active sheet is removed, and its name is output to the browser console:

Removed sheet name: Sheet1

The first sheet of the express report document becomes active:

See also:

EaxMdService