cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

WouterLemaire
Active Contributor
0 Kudos

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

junwu
Active Contributor
0 Kudos

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

0 Kudos

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