Skip to Content
avatar image
Former Member

How to Export filtered and sorted data from sap.m.Table to an Excel File ?

Hi Experts,

I need to export data to an Excel file(not CSV) from a sap.m.Table.

The data displayed on the table is both filtered and sorted.

Can you please suggest some code to implement that.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Apr 03, 2017 at 04:01 PM

    Hi,

    Please go through below, but there a issue for data formats

    https://answers.sap.com/questions/167183/export-to-excel-exporttypecsv-data-formatted-prepe.html

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 04, 2017 at 03:55 PM

    you need external js lib to do the job or use the standard odata service which support xlsx export.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 04, 2017 at 06:45 PM

    You could use the smarttable control: https://sapui5.hana.ondemand.com/explored.html#/entity/sap.ui.comp.smarttable.SmartTable/samples

    Inside the smarttable is a table control where you can add filters to by accessing the table like this:

    var table = this.byId("idOfTheSmartTable").getTable();
    var oObjectBinding = oObject.getBinding("items"); 
    oObjectBinding.filter(<filter>);
    

    Kr,

    Wouter

    Add comment
    10|10000 characters needed characters exceeded