EaxMdService.setCellsAutoFit

Syntax

setCellsAutoFit(report: PP.Exp.EaxAnalyzer, metadata: EaxGridAdjust, sizeMd, callback);

Parameters

report. Express report to which the method is applied

metadata. Object that contains cell autofit settings.

sizeMd. Object that stores document sheet size.

callback. Callback function.

Description

The setCellsAutoFit method enables autofit option for cells of 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. This table may look as follows:

Set autofit style for cells of express report table:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get express report document
var eaxAnalyzer = expressBox.getSource();
// Initialize callback function
var onOpenAutoFitSet = function () {
    expressBox.getDataView().refreshAll();
    expressBox.getDataView().setIsVisible(PP.Ui.Visibility.Visible)
};
// Determine document sheet size
var sizeMd = PP.getProperty(eaxAnalyzer.getMetadata(), "grid.adjust");
// Determine cell autofit settings
var state = expressBox.getDataView().getGridView().getTabSheetViewState();
eaxMdService.setCellsAutoFit(eaxAnalyzer, state, sizeMd, PP.Delegate(onOpenAutoFitSet, eaxMdService));
// Refresh express report
expressBox.refreshAll();

After executing the example and cell autofit the express report table looks as follows:

See also:

EaxMdService