Class sap.ui.core.util.ExportModule: sap/ui/core/util/Export

extends Control

Export provides the possibility to generate a list of data in a specific format / type, e.g. CSV to use it in other programs / applications.


Since: 1.22.0.
Constructor Summary
new sap.ui.core.util.Export(sId?, mSettings?)Constructor for a new Export.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.core.util.Export.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.util.Export with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.util.Export.getMetadata()Returns a metadata object for class sap.ui.core.util.Export.
addColumn(oColumn)Adds some column to the aggregation columns.
addRow(oRow)Adds some row to the aggregation rows.
bindColumns(oBindingInfo)Binds aggregation columns to model data.
bindRows(oBindingInfo)Binds aggregation rows to model data.
destroyColumns()Destroys all the columns in the aggregation columns.
destroyExportType()Destroys the exportType in the aggregation exportType.
destroyRows()Destroys all the rows in the aggregation rows.
generate()Generates the file content and returns a Promise with the instance as context (this).
getColumns()Gets content of aggregation columns.
getExportType()Gets content of aggregation exportType.
getRows()Gets content of aggregation rows.
indexOfColumn(oColumn)Checks for the provided sap.ui.core.util.ExportColumn in the aggregation columns.
indexOfRow(oRow)Checks for the provided sap.ui.core.util.ExportRow in the aggregation rows.
insertColumn(oColumn, iIndex)Inserts a column into the aggregation columns.
insertRow(oRow, iIndex)Inserts a row into the aggregation rows.
removeAllColumns()Removes all the controls from the aggregation columns.
removeAllRows()Removes all the controls from the aggregation rows.
removeColumn(vColumn)Removes a column from the aggregation columns.
removeRow(vRow)Removes a row from the aggregation rows.
saveFile(sFileName?)Generates the file content, triggers a download / save action and returns a Promise with the instance as context (this).
setExportType(oExportType)Sets the aggregated exportType.
unbindColumns()Unbinds aggregation columns from model data.
unbindRows()Unbinds aggregation rows from model data.
Constructor Detail
new sap.ui.core.util.Export(sId?, mSettings?)
Constructor for a new Export.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Aggregations
    • exportType : sap.ui.core.util.ExportType
    • columns : sap.ui.core.util.ExportColumn[]
    • rows : sap.ui.core.util.ExportRow[]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Method Detail
sap.ui.core.util.Export.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.util.Export with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.core.util.Export.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.util.Export.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addColumn(oColumn): sap.ui.core.util.Export
Adds some column to the aggregation columns.
Parameters:
{sap.ui.core.util.ExportColumn}oColumn the column to add; if empty, nothing is inserted
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
Adds some row to the aggregation rows.
Parameters:
{sap.ui.core.util.ExportRow}oRow the row to add; if empty, nothing is inserted
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
bindColumns(oBindingInfo): sap.ui.core.util.Export
Binds aggregation columns to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
{object}oBindingInfo The binding information
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
bindRows(oBindingInfo): sap.ui.core.util.Export
Binds aggregation rows to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
{object}oBindingInfo The binding information
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
destroyColumns(): sap.ui.core.util.Export
Destroys all the columns in the aggregation columns.
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
destroyExportType(): sap.ui.core.util.Export
Destroys the exportType in the aggregation exportType.
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
destroyRows(): sap.ui.core.util.Export
Destroys all the rows in the aggregation rows.
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
generate(): Promise
Generates the file content and returns a Promise with the instance as context (this).
The promise will be resolved with the generated content as a string.

Please note: The return value was changed from jQuery Promises to standard ES6 Promises. jQuery specific Promise methods ('done', 'fail', 'always', 'pipe' and 'state') are still available but should not be used. Please use only the standard methods 'then' and 'catch'!

Returns:
{Promise} Promise object
Gets content of aggregation columns.

Columns for the Export.

Returns:
{sap.ui.core.util.ExportColumn[]}
getExportType(): sap.ui.core.util.ExportType
Gets content of aggregation exportType.

Type that generates the content.

Returns:
{sap.ui.core.util.ExportType}
Gets content of aggregation rows.

Rows of the Export.

Returns:
{sap.ui.core.util.ExportRow[]}
indexOfColumn(oColumn): int
Checks for the provided sap.ui.core.util.ExportColumn in the aggregation columns. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.core.util.ExportColumn}oColumn The column whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfRow(oRow): int
Checks for the provided sap.ui.core.util.ExportRow in the aggregation rows. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.core.util.ExportRow}oRow The row whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertColumn(oColumn, iIndex): sap.ui.core.util.Export
Inserts a column into the aggregation columns.
Parameters:
{sap.ui.core.util.ExportColumn}oColumn the column to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the column should be inserted at; for a negative value of iIndex, the column is inserted at position 0; for a value greater than the current size of the aggregation, the column is inserted at the last position
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
insertRow(oRow, iIndex): sap.ui.core.util.Export
Inserts a row into the aggregation rows.
Parameters:
{sap.ui.core.util.ExportRow}oRow the row to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the row should be inserted at; for a negative value of iIndex, the row is inserted at position 0; for a value greater than the current size of the aggregation, the row is inserted at the last position
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
removeAllColumns(): sap.ui.core.util.ExportColumn[]
Removes all the controls from the aggregation columns.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.core.util.ExportColumn[]} An array of the removed elements (might be empty)
removeAllRows(): sap.ui.core.util.ExportRow[]
Removes all the controls from the aggregation rows.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.core.util.ExportRow[]} An array of the removed elements (might be empty)
removeColumn(vColumn): sap.ui.core.util.ExportColumn
Removes a column from the aggregation columns.
Parameters:
{int|string|sap.ui.core.util.ExportColumn}vColumn The columnto remove or its index or id
Returns:
{sap.ui.core.util.ExportColumn} The removed column or null
removeRow(vRow): sap.ui.core.util.ExportRow
Removes a row from the aggregation rows.
Parameters:
{int|string|sap.ui.core.util.ExportRow}vRow The rowto remove or its index or id
Returns:
{sap.ui.core.util.ExportRow} The removed row or null
saveFile(sFileName?): Promise
Generates the file content, triggers a download / save action and returns a Promise with the instance as context (this).
The promise will be resolved with the generated content as a string.

For information about browser support, see sap.ui.core.util.File.save

Please note: The return value was changed from jQuery Promises to standard ES6 Promises. jQuery specific Promise methods ('done', 'fail', 'always', 'pipe' and 'state') are still available but should not be used. Please use only the standard methods 'then' and 'catch'!

Parameters:
{string}sFileName? file name, defaults to 'data'
Returns:
{Promise} Promise object
setExportType(oExportType): sap.ui.core.util.Export
Sets the aggregated exportType.
Parameters:
{sap.ui.core.util.ExportType}oExportType The exportType to set
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
unbindColumns(): sap.ui.core.util.Export
Unbinds aggregation columns from model data.
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining
Unbinds aggregation rows from model data.
Returns:
{sap.ui.core.util.Export} Reference to this in order to allow method chaining