cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 upload data xlsx, xls to table

benlim
Contributor
0 Kudos

Hi,

I've followed below blog and was getting error that read is undefined which is asked on the last comment. Any idea on the actual solution to upload xlsx and xls file to sapui5 table?

Read contents of Excel file into Sapui5 table

Regards,

-Ben-

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member484715
Contributor

Hi Yen Shen, Ben Lim,

The variable name they have used is "reader". Could you check once with that. Go through the foll. blogs to know more on uploading excel data in SAPUI5 :

https://blogs.sap.com/2017/05/17/sapui5-ms-excel-file-upload/

https://blogs.sap.com/2015/07/17/excel-file-upload-in-sapui5master-data-upload-using-sapui5/

http://codetheory.in/parse-read-excel-files-xls-xlsx-javascript/

Hope this helps,

Regards,

Arjun Biswas

benlim
Contributor
0 Kudos

Hi @Arjun Biswas,

The 1st link and 2nd link you shared are cater for csv format.

The 3rd link is using the 3rd party library. Same like the library shared in the blog I mentioned.

Why XLSX.read is undefined as there is no syntax error on my code as I've defined the library at top sap.ui.define.

Regards,

-Ben-

former_member484715
Contributor
0 Kudos

Could you log the "XLSX" object and check. As per my understanding, I think you are not getting the required object reference there.

Regards,

Arjun Biswas

benlim
Contributor
0 Kudos

Ya, I tried log the XLSX object, is undefined. Below is my xlsx file locate and my declaration. Which part do I missed out in order to get the library object?

Regards,

-Ben-

former_member484715
Contributor
0 Kudos

Hi Ben,

I am not sure, which part you might have missed, but I think that this error is caused due to the resource roots, i.e. your controller is not able to access the xlsx.js file.

Regards,

Arjun Biswas