setTableCFormat(report: PP.Exp.EaxDocument, metadata: Object, callback: PP.Delegate);
report. Express report document.
metadata. Table formatting settings.
callback. Callback function.
The setTableCFormat method sets conditional formatting for express report table.
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. Change table formatting and color the cells by scaling their values with the colors from green to red:
// 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: { PredefinedScale: PP.Exp.Ui.TabTablePredefinedScale.GreenRed, // Set green and red color Type: "Scale" // Coloring of cells by means of zooming their values } }; // Determine arguments for callback function var args = new PP.Mb.Ui.PropertyChangedEventArgs({ PropertyName: PP.Exp.Ui.RibbonTableEnum.CFormat, Metadata: metadata, TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.PropertyBar, PP.Exp.Ui.ViewTypeUpdate.Table] }); // 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); }; // Set new table formatting eaxMbService.setTableCFormat(eaxAnalyzer, metadata, PP.Delegate(this.onPanelChanged, eaxMdService, args)); // Refresh express report expressBox.refreshAll();
After executing the example formatting of express report table is changed, and the cells are colored by scaling their values with the colors from green to red:
See also: