EaxMdService.renameSheet

Syntax

renameSheet(doc, sheetKey, sheetName, callback);

Parameters

doc. Express report document to be renamed.

sheetKey. Document sheet key.

sheetName. New name of the document.

callback. Callback function.

Description

The renameSheet method renames a sheet of express report document.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Rename the current sheet of express report document:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get express report document
var eaxDocument = expressBox.getSource();
// Get key of express report active sheet
var sheetKey = eaxDocument.getActiveSheetKey();
var sheetName = "New name"; // Determine a new sheet name
var onSheetRenamed = function (n, t) {
    expressBox.getDataView().getSource().getSheets()[t.Args.SheetKey].setName(t.Args.SheetName),
    expressBox.getDataView().refresh(),
    expressBox.getDataView().DocDataChanged.fire(this, new PP.Mb.Ui.PropertyChangedEventArgs({
        PropertyName: PP.Exp.Ui.ControlType.DataView,
        Metadata: null,
        TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.Ribbon, PP.Exp.Ui.ViewTypeUpdate.PropertyBar, PP.Exp.Ui.ViewTypeUpdate.Title]        
    }))
};
eaxMdService.renameSheet(eaxDocument, sheetKey, sheetName, PP.Delegate(onSheetRenamed, this, {
    SheetKey: sheetKey,
    SheetName: sheetName
}));
// Refresh express report
expressBox.refreshAll();

After executing the example the current sheet of express report document is renamed, and the browser console displays an appropriate message:

Current name of the active sheet: Dynamics for the region
New name of the active sheet: New name

See also:

EaxMdService