
Hello UI5 Gurus,
In my view I have a table created using sap.ui.table library , I have given it a custom id "TAB2"
Now in my controller side I have written code for Downloading Table control data, I have attached screenshot.
I am getting Excel file downloaded , but its with empty contents.
Can anyone please suggest, what needs to be rectified.
Thanks,
Sijin
Request clarification before answering.
Hi Sijin,
Please look at the following code:
OnExcelAssets: function(oEvt){
var oModel = this.getView().getModel("masterView");
var oData = oModel.getData();
var oTab = this.getView().byId("TAB2");
var oBinding = oTab.getBinding("items");
var oExport = new Export({
exportType : new ExportTypeCSV({
separatorChar : ";"
}),
models : this.getView().getModel("masterView"),
rows : {
path : "/myAssets",
filters: oBinding.aFilters
},
columns : [{
name : this.getResourceBundle().getText("actCol1"),
template : {
content : "{Anln1}"
}
}, {
name : this.getResourceBundle().getText("actCol2"),
template : {
content : "{Txt50}"
}
},{
name : this.getResourceBundle().getText("actCol6"),
template : {
content : "{Zzestadotxt}"
}
}]
});
this.onExcel(oExport);
},
onExcel: sap.m.Table.prototype.exportData || function(oExport){
var vText = this.getResourceBundle().getText("errorPressExcel");
// download exported file
oExport.saveFile().catch(function(oError) {
//Handle your error
}).then(function() {
oExport.destroy();
});
},
Regards,
John.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.