SAP UI5 SmartTable 控件本地运行时进行 Excel 导出的单步调试(一)

简介: SAP UI5 SmartTable 控件本地运行时进行 Excel 导出的单步调试

点击 SmartTable 控件生成的表格控件的 Export to Excel 时,遇到如下错误消息:



The following error has occurred during export:


Unexpected server response:



SmartTable 基于的是 OData V4 的模型了:



Excel export 操作,触发的是一个 batch 请求:



--batch_aaedc4df-e8bd-48e9-8f7b-daf23bd75db4
Content-Type: application/http
Content-Transfer-Encoding: binary
GET Products?$format=json&$select=ProductId%2cPrice%2cCurrencyCode%2cName%2cCategory&$skip=0&$top=14 HTTP/1.1
sap-contextid-accept:header
Accept:application/json
Accept-Language:en-US
DataServiceVersion:2.0
MaxDataServiceVersion:2.0
X-Requested-With:XMLHttpRequest
x-csrf-token:42424242424242424242424242424242
--batch_aaedc4df-e8bd-48e9-8f7b-daf23bd75db4--


步骤 147 的 Mock Server,没有针对这个 batch 请求进行实现。


因此返回 404 Not Found 错误:




对应的 excel button:




实现的源文件:https://sapui5.hana.ondemand.com/resources/sap/ui/export/SpreadsheetExport-dbg.js




SAP UI5 已经默认使用 web worker 技术在另一个线程里触发 excel 导出的请求了。


如果 worker 参数是 false,默认在主线程里触发,这样可能会阻塞主线程,影响用户体验。


Web Worker:https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers




我现在的团队要做购物车里商品清单的 Excel 导出功能,这让我马上联想到 SAP UI5 的 Table Excel 导出功能。




相关文章
|
20天前
|
C# 开发者 Windows
基于Material Design风格开源、易用、强大的WPF UI控件库
基于Material Design风格开源、易用、强大的WPF UI控件库
|
1月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
27 0
|
1月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
15 0
|
20天前
|
XML Java Android开发
Android之UI基础控件
Android之UI基础控件
|
25天前
什么是 SAP ABAP 里的 Subscreen
什么是 SAP ABAP 里的 Subscreen
16 1
什么是 SAP ABAP 里的 Subscreen
|
1月前
|
开发者 UED
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
15 0
|
27天前
|
SQL 缓存 easyexcel
面试官问10W 行级别数据的 Excel 导入如何10秒处理
面试官问10W 行级别数据的 Excel 导入如何10秒处理
55 0
|
1月前
|
安全 Java 数据库连接
jdbc解析excel文件,批量插入数据至库中
jdbc解析excel文件,批量插入数据至库中
21 0
|
1月前
|
Java API Apache
使用AOP+反射实现Excel数据的读取
使用AOP+反射实现Excel数据的读取
|
1月前
|
SQL 数据可视化 数据处理
使用SQL和Python处理Excel文件数据
使用SQL和Python处理Excel文件数据
54 0

热门文章

最新文章