EaxMdService.setNumberFormat

Syntax

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

Parameters

report. Express report document.

metadata. JSON object with the @FT field that determines index of table data format. Value of this field is set using the PP.Exp.Ui.RibbonTableNFormatEnum enumeration.

callback. Callback function.

Description

The setNumberFormat method sets format of data 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 express report working area. Open the table and set currency format for its data:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get express report document
var eaxAnalyzer = expressBox.getSource();
// Determine metadata
var metadata = {};
metadata["@FT"] = PP.Exp.Ui.RibbonTableNFormatEnum.Money; // Set currency format
// Determine  arguments for callback function
var args = new PP.Mb.Ui.PropertyChangedEventArgs({   
    PropertyName: PP.Exp.Ui.RibbonTableEnum.TableNumber,
    Metadata: metadata,
    TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.Table, PP.Exp.Ui.ViewTypeUpdate.Ribbon]
});
// Determine callback function
var onPanelChanged = function (n, t) {        
    var chartView = expressBox.getDataView().getChartView();    
    t ? (chartView.DataChanged.fire(chartView, t.Args), t.Args.fireCallback(n, t)) : chartView.DataChanged.fire(chartView, t);
};
// Change number display format
eaxMbService.setNumberFormat(eaxAnalyzer, metadata, PP.Delegate(this.onPanelChanged, eaxMdService, args));
// Refresh express report
expressBox.refreshAll();

After executing the example currency format is applied to data of express report table:

See also:

EaxMdService