on 04-02-2015 12:11 PM
Hi Experts,
I am working in an assignment and i have a requirement where i need to browse and upload a csv/ excel file in to a sap.m table. I know about sap.m.UploadCollection, but not able to get the file uploaded in to the ui5 client side table.
Please provide some suggestions here.
Regards,
Imran
Hi, I use sap.ui.unidied.FileUploader and file API(supported all modern browsers and IE10+).
<FileUploader xmlns="sap.ui.unified"
uploadUrl=""
buttonText="{i18n>detailBtnImport}"
fileType="csv"
maximumFileSize="1"
buttonOnly="true"
icon="sap-icon://upload"
change="onChangeFUP"
uploadComplete="onUploadCompleteFUP"
typeMissmatch="onFailedFUP"
fileSizeExceed="onFailedFUP"
uploadAborted="onFailedFUP"
filenameLengthExceed="onFailedFUP"/>
onChangeFUP : function(e) {
this._import(e.getParameter("files") && e.getParameter("files")[0]);
},
_import : function(file) {
if(file && window.FileReader){
var reader = new FileReader();
var that = this;
reader.onload = function(e) {
var strCSV= e.target.result; //string in CSV
};reader.readAsText(file);
}
Regards,
Raman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
Am able to extract the csv file into json format , but am not able to bind it to the sapui5 table.
could you please help me.
Please check my code :
otable1.bindAggregation("items",{
path: "/modelData",
template : coltemplate
});
};
modelData contains the records in json format
Regards,
Vikash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
72 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.