Skip to Content

Read content from .XLSX file to sap.m.table

Hi,

I have an sap.m.table control in my application. The table is getting populated with data from DB in JSON format.

There is a requirement that requires the table data to be populated based on the content of the .XLSX file which will have the same format as the DB table data.

I need help with the code that can do following:

Browse to a .XLSX file on the local machine.

Read the content from the .XLSX file and provide the output as JSON.

Populate sap.m.table with the output JSON.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 10 at 05:50 PM

    Hi Anoop,

    Do you mean your app will need be able to have an upload function that will "parse" the Excel sheet and display it in a UI5 Table using JSON format? Maybe this would help... Here is a question done on this subject via SAP Community as well.

    Since you already have the data on a DB, why not upload it via JDBC connection directly from Excel?

    Or better yet. Why don't you connect to your DB from Excel to display the table and edit it directly from Excel?

    Having the upload feature will give you much more work to maintain this app. You will need to use a JS library to parse the Excel file, looking after predefined column names. If the user changes the column names, your app behave awkwardly.

    Regards,
    Ivan

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 02 at 12:43 AM

    Thanks for your response Ivan. Ended up using JS library as that suited best to the requirement and works fine.

    Add comment
    10|10000 characters needed characters exceeded