@sapui5/sap.ui.export 1.94.0 → 1.96.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/ui/export/.library +45 -47
- package/src/sap/ui/export/ExportBase.js +197 -0
- package/src/sap/ui/export/ExportUtils.js +71 -10
- package/src/sap/ui/export/PortableDocument.js +284 -0
- package/src/sap/ui/export/Spreadsheet.js +35 -162
- package/src/sap/ui/export/SpreadsheetExport.js +1 -1
- package/src/sap/ui/export/js/XLSXBuilder.js +1 -1
- package/src/sap/ui/export/js/XLSXBuilder.js.map +1 -1
- package/src/sap/ui/export/library.js +9 -2
- package/src/sap/ui/export/messagebundle.properties +3 -0
- package/src/sap/ui/export/messagebundle_ar.properties +2 -0
- package/src/sap/ui/export/messagebundle_bg.properties +2 -0
- package/src/sap/ui/export/messagebundle_ca.properties +2 -0
- package/src/sap/ui/export/messagebundle_cs.properties +2 -0
- package/src/sap/ui/export/messagebundle_cy.properties +2 -0
- package/src/sap/ui/export/messagebundle_da.properties +2 -0
- package/src/sap/ui/export/messagebundle_de.properties +2 -0
- package/src/sap/ui/export/messagebundle_el.properties +2 -0
- package/src/sap/ui/export/messagebundle_en.properties +2 -0
- package/src/sap/ui/export/messagebundle_en_GB.properties +2 -0
- package/src/sap/ui/export/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/ui/export/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/ui/export/messagebundle_en_US_saptrc.properties +2 -0
- package/src/sap/ui/export/messagebundle_es.properties +2 -0
- package/src/sap/ui/export/messagebundle_es_MX.properties +2 -0
- package/src/sap/ui/export/messagebundle_et.properties +2 -0
- package/src/sap/ui/export/messagebundle_fi.properties +2 -0
- package/src/sap/ui/export/messagebundle_fr.properties +2 -0
- package/src/sap/ui/export/messagebundle_fr_CA.properties +2 -0
- package/src/sap/ui/export/messagebundle_hi.properties +2 -0
- package/src/sap/ui/export/messagebundle_hr.properties +2 -0
- package/src/sap/ui/export/messagebundle_hu.properties +2 -0
- package/src/sap/ui/export/messagebundle_id.properties +2 -0
- package/src/sap/ui/export/messagebundle_it.properties +3 -1
- package/src/sap/ui/export/messagebundle_iw.properties +2 -0
- package/src/sap/ui/export/messagebundle_ja.properties +2 -0
- package/src/sap/ui/export/messagebundle_kk.properties +2 -0
- package/src/sap/ui/export/messagebundle_ko.properties +2 -0
- package/src/sap/ui/export/messagebundle_lt.properties +2 -0
- package/src/sap/ui/export/messagebundle_lv.properties +2 -0
- package/src/sap/ui/export/messagebundle_ms.properties +2 -0
- package/src/sap/ui/export/messagebundle_nl.properties +2 -0
- package/src/sap/ui/export/messagebundle_no.properties +2 -0
- package/src/sap/ui/export/messagebundle_pl.properties +2 -0
- package/src/sap/ui/export/messagebundle_pt.properties +2 -0
- package/src/sap/ui/export/messagebundle_pt_PT.properties +2 -0
- package/src/sap/ui/export/messagebundle_ro.properties +2 -0
- package/src/sap/ui/export/messagebundle_ru.properties +4 -2
- package/src/sap/ui/export/messagebundle_sh.properties +2 -0
- package/src/sap/ui/export/messagebundle_sk.properties +4 -2
- package/src/sap/ui/export/messagebundle_sl.properties +2 -0
- package/src/sap/ui/export/messagebundle_sv.properties +2 -0
- package/src/sap/ui/export/messagebundle_th.properties +2 -0
- package/src/sap/ui/export/messagebundle_tr.properties +2 -0
- package/src/sap/ui/export/messagebundle_uk.properties +2 -0
- package/src/sap/ui/export/messagebundle_vi.properties +2 -0
- package/src/sap/ui/export/messagebundle_zh_CN.properties +2 -0
- package/src/sap/ui/export/messagebundle_zh_TW.properties +2 -0
- package/src/sap/ui/export/provider/DataProviderBase.js +1 -1
- package/src/sap/ui/export/themes/sap_horizon/library.source.less +8 -0
- package/ui5.yaml +2 -3
package/package.json
CHANGED
|
@@ -1,47 +1,45 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
-
<library xmlns="http://www.sap.com/sap.ui.library.xsd">
|
|
3
|
-
|
|
4
|
-
<name>sap.ui.export</name>
|
|
5
|
-
<vendor>SAP SE</vendor>
|
|
6
|
-
<copyright>SAPUI5
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</library>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<library xmlns="http://www.sap.com/sap.ui.library.xsd">
|
|
3
|
+
|
|
4
|
+
<name>sap.ui.export</name>
|
|
5
|
+
<vendor>SAP SE</vendor>
|
|
6
|
+
<copyright>SAPUI5
|
|
7
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved.</copyright>
|
|
8
|
+
<version>1.96.3</version>
|
|
9
|
+
|
|
10
|
+
<documentation>UI5 library: sap.ui.export</documentation>
|
|
11
|
+
|
|
12
|
+
<dependencies>
|
|
13
|
+
<dependency>
|
|
14
|
+
<libraryName>sap.ui.core</libraryName>
|
|
15
|
+
</dependency>
|
|
16
|
+
</dependencies>
|
|
17
|
+
|
|
18
|
+
<appData>
|
|
19
|
+
<!-- excludes for the JSDoc -->
|
|
20
|
+
<jsdoc xmlns="http://www.sap.com/ui5/buildext/jsdoc">
|
|
21
|
+
<exclude name="sap.ui.export.js."/>
|
|
22
|
+
</jsdoc>
|
|
23
|
+
<documentation xmlns="http://www.sap.com/ui5/buildext/documentation"
|
|
24
|
+
indexUrl="../../../../test-resources/sap/ui/export/demokit/docuindex.json" resolve="lib"/>
|
|
25
|
+
<releasenotes xmlns="http://www.sap.com/ui5/buildext/releasenotes"
|
|
26
|
+
url="../../../../test-resources/sap/ui/export/relnotes/changes-{major}.{minor}.json" resolve="lib"/>
|
|
27
|
+
<!-- excludes for the JSCoverage -->
|
|
28
|
+
<jscoverage xmlns="http://www.sap.com/ui5/buildext/jscoverage">
|
|
29
|
+
<exclude name="sap.ui.export.js."/>
|
|
30
|
+
</jscoverage>
|
|
31
|
+
<packaging xmlns="http://www.sap.com/ui5/buildext/packaging" version="2.0">
|
|
32
|
+
<module-infos>
|
|
33
|
+
<raw-module name="sap/ui/export/js/XLSXBuilder.js" requiresTopLevelScope="false" />
|
|
34
|
+
</module-infos>
|
|
35
|
+
<all-in-one>
|
|
36
|
+
<!-- exclude third party bundles and the worker code -->
|
|
37
|
+
<exclude name="sap/ui/export/js/**" />
|
|
38
|
+
</all-in-one>
|
|
39
|
+
</packaging>
|
|
40
|
+
<ownership xmlns="http://www.sap.com/ui5/buildext/ownership">
|
|
41
|
+
<component>CA-UI5-TBL</component><!-- default component for library -->
|
|
42
|
+
</ownership>
|
|
43
|
+
</appData>
|
|
44
|
+
|
|
45
|
+
</library>
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAPUI5
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
'sap/ui/core/Core',
|
|
8
|
+
'sap/ui/base/EventProvider',
|
|
9
|
+
'sap/base/Log',
|
|
10
|
+
'sap/ui/export/ExportUtils'
|
|
11
|
+
], function(Core, EventProvider, Log, ExportUtils) {
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @constructor The <code>sap.ui.export.ExportBase</code> class allows you to export table data from a UI5 application to a Portable Document Format (*.PDF) file.
|
|
16
|
+
*
|
|
17
|
+
* @author SAP SE
|
|
18
|
+
* @version 1.96.3
|
|
19
|
+
*
|
|
20
|
+
* @since 1.96
|
|
21
|
+
* @name sap.ui.export.ExportBase
|
|
22
|
+
* @extends sap.ui.base.EventProvider
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
var ExportBase = EventProvider.extend('sap.ui.export.ExportBase', {
|
|
26
|
+
|
|
27
|
+
constructor: function(mSettings) {
|
|
28
|
+
EventProvider.call(this, mSettings);
|
|
29
|
+
|
|
30
|
+
/* Default settings */
|
|
31
|
+
this._mSettings = {
|
|
32
|
+
fileName: 'Export'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/* Only apply supported properties */
|
|
36
|
+
// IMPORTANT: keep count before dataSource to ensure that the expected count can be used for dataSource string
|
|
37
|
+
['count', 'dataSource', 'fileName', 'fileType', 'workbook'].forEach(function(sProperty) {
|
|
38
|
+
if (typeof mSettings[sProperty] !== 'undefined') {
|
|
39
|
+
this._mSettings[sProperty] = sProperty !== 'dataSource' ? mSettings[sProperty] : this.processDataSource(mSettings[sProperty]);
|
|
40
|
+
}
|
|
41
|
+
}.bind(this));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The <code>beforeExport</code> event is fired just before the export process is started.
|
|
47
|
+
*
|
|
48
|
+
* @name sap.ui.export.ExportBase#beforeExport
|
|
49
|
+
* @event
|
|
50
|
+
* @param {sap.ui.base.Event} oEvent
|
|
51
|
+
* @param {sap.ui.base.EventProvider} oEvent.getSource
|
|
52
|
+
* @param {object} oEvent.getParameters
|
|
53
|
+
* @param {ArrayBuffer} oEvent.getParameter.exportSettings - Contains export-related configuration
|
|
54
|
+
*
|
|
55
|
+
* @since 1.96
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Attaches event handler <code>fnFunction</code> to the {@link sap.ui.export.ExportBase#event:beforeExport}
|
|
61
|
+
* event of this <code>sap.ui.export.ExportBase</code>.</br>
|
|
62
|
+
* When called, the context of the event handler (its <code>this</code>) will be bound to <code>oListener</code> if specified,
|
|
63
|
+
* otherwise it will be bound to this <code>sap.ui.export.ExportBase</code> itself.</br>
|
|
64
|
+
* This event is fired just before the export process is started.
|
|
65
|
+
*
|
|
66
|
+
* @param {object} [oData] An application-specific payload object that will be passed to the event handler along with the event object when firing the event
|
|
67
|
+
* @param {function} fnHandler The function to be called when the event occurs
|
|
68
|
+
* @param {object} [oListener] Context object to call the event handler with. Defaults to the <code>sap.ui.export.ExportBase</code> instance itself
|
|
69
|
+
*
|
|
70
|
+
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
71
|
+
*
|
|
72
|
+
* @name sap.ui.export.ExportBase#attachBeforeExport
|
|
73
|
+
* @function
|
|
74
|
+
* @since 1.96
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
ExportBase.prototype.attachBeforeExport = function(oData, fnHandler, oListener) {
|
|
78
|
+
return this.attachEvent('beforeExport', oData, fnHandler, oListener);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Detaches event handler <code>fnFunction</code> from the {@link sap.ui.export.ExportBase#event:beforeExport}
|
|
83
|
+
* event of this <code>sap.ui.export.ExportBase</code>.</br>
|
|
84
|
+
* The passed function and listener object must match the ones used for event registration.
|
|
85
|
+
*
|
|
86
|
+
* @param {function} fnHandler The function to be called when the event occurs
|
|
87
|
+
* @param {object} [oListener] Context object on which the given function had to be called
|
|
88
|
+
*
|
|
89
|
+
* @returns {this} Reference to <code>this</code> in order to allow method chaining
|
|
90
|
+
*
|
|
91
|
+
* @name sap.ui.export.ExportBase#detachBeforeExport
|
|
92
|
+
* @function
|
|
93
|
+
* @since 1.96
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
ExportBase.prototype.detachBeforeExport = function(fnHandler, oListener) {
|
|
97
|
+
return this.detachEvent('beforeExport', fnHandler, oListener);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Cleans up the internal structures and removes all event handlers.
|
|
102
|
+
*
|
|
103
|
+
* The object must not be used anymore after destroy was called.
|
|
104
|
+
*
|
|
105
|
+
* @see sap.ui.base.Object#destroy
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
ExportBase.prototype.destroy = function() {
|
|
109
|
+
EventProvider.prototype.destroy.apply(this, arguments);
|
|
110
|
+
|
|
111
|
+
this.cancel();
|
|
112
|
+
this.bIsDestroyed = true;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Cancels the current export process.
|
|
117
|
+
*
|
|
118
|
+
* @function
|
|
119
|
+
* @abstract
|
|
120
|
+
* @name sap.ui.export.ExportBase#cancel
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
ExportBase.prototype.cancel = function() {
|
|
124
|
+
throw new Error('Abstract function not implemented');
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Sets the data source configuration that will be used for exporting the data. If the passed parameter is null,
|
|
129
|
+
* the call will be ignored.
|
|
130
|
+
*
|
|
131
|
+
* @param {Object|sap.ui.model.ListBinding|sap.ui.model.TreeBinding} oDataSource Possible types are a data
|
|
132
|
+
* source configuration, a <code>sap.ui.model.ListBinding</code> or <code>sap.ui.model.TreeBinding</code>
|
|
133
|
+
* @returns {Object|null} - Valid dataSource object or null in case the dataSource configuration is not supported
|
|
134
|
+
*
|
|
135
|
+
* @function
|
|
136
|
+
* @abstract
|
|
137
|
+
* @name sap.ui.export.ExportBase#processDataSource
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
ExportBase.prototype.processDataSource = function(oDataSource) {
|
|
141
|
+
throw new Error('Abstract function not implemented');
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Applies default settings to the export configuration.
|
|
146
|
+
*
|
|
147
|
+
* @param {Object} mSettings Export settings that will be adjusted
|
|
148
|
+
*
|
|
149
|
+
* @function
|
|
150
|
+
* @abstract
|
|
151
|
+
*/
|
|
152
|
+
ExportBase.prototype.setDefaultExportSettings = function(mSettings) {
|
|
153
|
+
throw new Error('Abstract function not implemented');
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Creates a Promise that will be resolved after the export has been finished.
|
|
158
|
+
*
|
|
159
|
+
* @param {Object} mSettings Validated export configuration
|
|
160
|
+
*
|
|
161
|
+
* @function
|
|
162
|
+
* @abstract
|
|
163
|
+
*/
|
|
164
|
+
ExportBase.prototype.createBuildPromise = function(mSettings) {
|
|
165
|
+
throw new Error('Abstract function not implemented');
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Triggers the export process of the specific format.
|
|
170
|
+
*
|
|
171
|
+
* @returns {Promise} Promise that gets resolved once the data has been exported
|
|
172
|
+
*
|
|
173
|
+
* @function
|
|
174
|
+
* @name sap.ui.export.ExportBase#build
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
ExportBase.prototype.build = function() {
|
|
178
|
+
var mParameters = this._mSettings;
|
|
179
|
+
|
|
180
|
+
if (this.bIsDestroyed) {
|
|
181
|
+
var sMessage = this.getMetadata().getName() + ': Cannot trigger build - the object has been destroyed';
|
|
182
|
+
|
|
183
|
+
Log.error(sMessage);
|
|
184
|
+
return Promise.reject(sMessage);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return this.setDefaultExportSettings(mParameters).then(function() {
|
|
188
|
+
this.fireEvent('beforeExport', {exportSettings: mParameters}, false, false);
|
|
189
|
+
|
|
190
|
+
ExportUtils.validateSettings(mParameters);
|
|
191
|
+
|
|
192
|
+
return this.createBuildPromise(mParameters);
|
|
193
|
+
}.bind(this));
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
return ExportBase;
|
|
197
|
+
});
|
|
@@ -53,7 +53,7 @@ sap.ui.define([
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
/* Returns the Export Settings used by the User Settings Dialog */
|
|
56
|
-
function getExportSettings(oCustomConfig, oResourceBundle) {
|
|
56
|
+
function getExportSettings(oCustomConfig, oResourceBundle, bDevMode) {
|
|
57
57
|
var sSelectedKey;
|
|
58
58
|
var oDefaultConfig = {
|
|
59
59
|
fileName: 'Standard',
|
|
@@ -66,6 +66,10 @@ sap.ui.define([
|
|
|
66
66
|
addDateTime: false
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
if (bDevMode) {
|
|
70
|
+
oDefaultConfig.fileType.push({key: 'pdf'});
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
var oExportConfig = Object.assign({}, oDefaultConfig, oCustomConfig || {});
|
|
70
74
|
|
|
71
75
|
for (var i = 0; i < oExportConfig.fileType.length; i++) {
|
|
@@ -89,7 +93,7 @@ sap.ui.define([
|
|
|
89
93
|
* Utilities related to export to enable reuse in integration scenarios (e.g. tables).
|
|
90
94
|
*
|
|
91
95
|
* @author SAP SE
|
|
92
|
-
* @version 1.
|
|
96
|
+
* @version 1.96.3
|
|
93
97
|
*
|
|
94
98
|
* @since 1.59
|
|
95
99
|
* @name sap.ui.export.ExportUtils
|
|
@@ -132,19 +136,20 @@ sap.ui.define([
|
|
|
132
136
|
* @param {Object} mCustomConfig Initial configuration of the settings dialog
|
|
133
137
|
* @param {sap.ui.core.Control} oOpener The opener of the dialog
|
|
134
138
|
* @param {function} [fnCallback] Handler function that is called once the dialog has been opened. A reference to the dialog is passed as parameter
|
|
139
|
+
* @param {boolean} [bDevMode] Flag that allows to activate settings that are currently in development
|
|
135
140
|
*
|
|
136
141
|
* @returns {Promise} Promise which resolves with the export settings defined by the user
|
|
137
142
|
*
|
|
138
143
|
* @static
|
|
139
144
|
*/
|
|
140
|
-
getExportSettingsViaDialog: function(mCustomConfig, oOpener, fnCallback) {
|
|
145
|
+
getExportSettingsViaDialog: function(mCustomConfig, oOpener, fnCallback, bDevMode) {
|
|
141
146
|
return new Promise(function (fnResolve, fnReject) {
|
|
142
147
|
var oExportSettingsDialog;
|
|
143
148
|
|
|
144
149
|
oResourceBundlePromise.then(function (oResourceBundle) {
|
|
145
150
|
|
|
146
151
|
var oExportConfigModel = new JSONModel();
|
|
147
|
-
oExportConfigModel.setData(getExportSettings(mCustomConfig, oResourceBundle));
|
|
152
|
+
oExportConfigModel.setData(getExportSettings(mCustomConfig, oResourceBundle, bDevMode));
|
|
148
153
|
|
|
149
154
|
var sDialogId = uid();
|
|
150
155
|
|
|
@@ -191,19 +196,17 @@ sap.ui.define([
|
|
|
191
196
|
new Label({
|
|
192
197
|
text: oResourceBundle.getText('SELECT_FORMAT'),
|
|
193
198
|
labelFor: sDialogId + '-fileType',
|
|
194
|
-
visible:
|
|
199
|
+
visible: !!bDevMode
|
|
195
200
|
}),
|
|
196
|
-
// sap.m.Select control disabled as there is only 1 option for now
|
|
197
|
-
// control must be enabled when more file types are supported
|
|
198
201
|
new Select({
|
|
199
202
|
id: sDialogId + '-fileType',
|
|
200
203
|
width: '100%',
|
|
201
204
|
selectedKey: '{/selectedFileType}',
|
|
202
|
-
visible: false,
|
|
203
205
|
items: {
|
|
204
206
|
path: '/fileType',
|
|
205
207
|
template: new Item({key: '{key}', text: '{text}'})
|
|
206
|
-
}
|
|
208
|
+
},
|
|
209
|
+
visible: !!bDevMode
|
|
207
210
|
}),
|
|
208
211
|
new CheckBox({
|
|
209
212
|
id: sDialogId + '-splitCells',
|
|
@@ -886,7 +889,7 @@ sap.ui.define([
|
|
|
886
889
|
*
|
|
887
890
|
* @param {Object} oContext Context object
|
|
888
891
|
* @param {string} [oContext.application] Name of the application (default: "SAP UI5")
|
|
889
|
-
* @param {string} [oContext.version] Application version (default: "1.
|
|
892
|
+
* @param {string} [oContext.version] Application version (default: "1.96.3")
|
|
890
893
|
* @param {string} [oContext.title] Title that will be written to the file (NOT the filename)
|
|
891
894
|
* @param {string} [oContext.modifiedBy] Optional user context that will be written to the file
|
|
892
895
|
* @param {string} [oContext.sheetName] Name of the data sheet - Maximum length of 31 characters
|
|
@@ -996,6 +999,10 @@ sap.ui.define([
|
|
|
996
999
|
_validateScaleCustomizing: function(oCustomizing, sProperty) {
|
|
997
1000
|
var sKey, mScaleSettings;
|
|
998
1001
|
|
|
1002
|
+
if (!oCustomizing) {
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
999
1006
|
mScaleSettings = oCustomizing[sProperty];
|
|
1000
1007
|
|
|
1001
1008
|
if (!(mScaleSettings instanceof Object) || Array.isArray(mScaleSettings)) {
|
|
@@ -1012,6 +1019,60 @@ sap.ui.define([
|
|
|
1012
1019
|
}
|
|
1013
1020
|
}
|
|
1014
1021
|
}
|
|
1022
|
+
},
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* Returns an instance of the specific export class that is evaluated
|
|
1026
|
+
* by FileType. The default class is sap/ui/export/Spreadsheet when
|
|
1027
|
+
* no specific FileType is defined in the export settings.
|
|
1028
|
+
*
|
|
1029
|
+
* @param {Object} mSettings Export configuration with optional FileType
|
|
1030
|
+
* @returns {Promise} A Promise that gets resolved with the requested instance
|
|
1031
|
+
*/
|
|
1032
|
+
getExportInstance: function(mSettings) {
|
|
1033
|
+
var sClassName, sFileType;
|
|
1034
|
+
|
|
1035
|
+
sFileType = typeof mSettings.fileType === 'string' ? mSettings.fileType.toUpperCase() : mSettings.fileType;
|
|
1036
|
+
|
|
1037
|
+
switch (sFileType) {
|
|
1038
|
+
case FileType.PDF:
|
|
1039
|
+
sClassName = 'sap/ui/export/PortableDocument';
|
|
1040
|
+
break;
|
|
1041
|
+
default:
|
|
1042
|
+
sClassName = 'sap/ui/export/Spreadsheet';
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
return new Promise(function(fnResolve) {
|
|
1046
|
+
sap.ui.require([sClassName], function(ExportClass) {
|
|
1047
|
+
fnResolve(new ExportClass(mSettings));
|
|
1048
|
+
});
|
|
1049
|
+
});
|
|
1050
|
+
},
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Returns the amount of data that is available on the backend
|
|
1054
|
+
* in case the binding provides this information.
|
|
1055
|
+
*
|
|
1056
|
+
* @param {sap.ui.model.ListBinding|sap.ui.model.TreeBinding} oBinding - A subclass of <code>sap.ui.model.ListBinding</code> or <code>sap.ui.model.TreeBinding</code>
|
|
1057
|
+
* @return {number|null} Amount of data in the backend or null if the binding does not provide this information
|
|
1058
|
+
*/
|
|
1059
|
+
getCountFromBinding: function(oBinding) {
|
|
1060
|
+
var iCount;
|
|
1061
|
+
|
|
1062
|
+
if (typeof oBinding.getCount === 'function') {
|
|
1063
|
+
iCount = oBinding.getCount();
|
|
1064
|
+
} else if (!oBinding.isA('sap.ui.model.TreeBinding') // Explicitly exclude TreeBinding because Binding#getLength is numberOfExpandedLevels dependent
|
|
1065
|
+
&& typeof oBinding.isLengthFinal === 'function'
|
|
1066
|
+
&& oBinding.isLengthFinal()) {
|
|
1067
|
+
|
|
1068
|
+
iCount = oBinding.getLength();
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
if (typeof iCount !== 'number' || iCount < 0 || isNaN(iCount)) {
|
|
1072
|
+
iCount = null;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
return iCount;
|
|
1015
1076
|
}
|
|
1016
1077
|
};
|
|
1017
1078
|
|