Skip to Content
avatar image
Former Member

Saving JSON data as an excel file / csv file

I have a table on UI5 application, and I want the download of that data to have some additional columns (than what is shown on the screen).
So I developed an oData which returns the required data as a JSON string.
Now I am having a difficult time saving the JSON as an excel / csv.
I tried the solution in http://jsfiddle.net/hybrid13i/JXrwM/ but it works only in Chrome.
a) How can I get the above to work in IE, and
b) Is there any other way in which I can save JSON data as a csv/excel file upon click of a button.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 30, 2017 at 11:55 AM

    Hi,

    If you are using sap.ui.table.Table and want to download the complete table in csv file then you can use:

    var oTable = this.getView().byId("idTable");
    oTable.exportData().saveFile("File_Name");
    

    If you want to download JSON data then you can see the API sap.ui.core.util.Export

    https://sapui5.hana.ondemand.com/1.44.14/#docs/api/symbols/sap.ui.core.util.Export.html

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 03, 2017 at 06:27 AM
    Add comment
    10|10000 characters needed characters exceeded