我正在尝试将表格数据导出到 Excel 工作表。没有格式化程序一切正常。但在将表格转换为 Excel 之前,我必须先格式化一些单元格。我正在调试代码。格式化程序函数的参数作为空值传递。这是我的代码:
var oExport = new sap.ui.core.util.Export({
exportType: new sap.ui.core.util.ExportTypeCSV({
separatorChar: ";"
}),
models: this.getView().getModel(),
rows: {
path: "/FaaliyetServisiSet"
},
columns: [{
name: "Kişi",
template: {
content: "{Klnad}"
}
}, {
name: "Faaliyet",
template: {
content: "{Falyt}"
}
}, {
name: "Süre",
template: {
content: {
parts: ["Sure"],
formatter: function(oValue) { // oValue is null that's the problem !!!!!!!
oValue = oValue + 2;
return oValue;
}
}
}
}, {
name: "Proje",
template: {
content: "{Proje}"
}
},
]
});
最佳答案
您应该为部分
使用对象数组而不是字符串
parts: [
{ path: "Sure" }
]
https://openui5.hana.ondemand.com/#docs/guide/07e4b920f5734fd78fdaa236f26236d8.html
关于excel - 格式化程序参数作为 null 传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30260117/