cancel
Showing results for 
Search instead for 
Did you mean: 

How to export SAPUI5 form to Excel ?

former_member184238
Participant
0 Kudos

Hi,

In my Project I have created one form to display all data regarding Employee.

The Sample structure of Form is like below.

Now my problem is when click on button I want to export this form into Excel Form.

To get the something like this I used below code.

window.open('data:application/vnd.ms-excel,' + encodeURIComponent($('#dvData').html()));

I am getting Excel sheet but not in that format.

In my Excel I got two problems.

  • 1. The width of cells increased based on the data in that cell.(I am not getting the width on that Form)
  • 2. In that form we have two tables.
    • One is having 6 columns
    • Second one is having 7 columns

How to get these Two tables with in Same width ?

How to get the External css also to get the Form like that?

I am getting columns with same width from top to bottom.But in my Form It is totally different. Is it possible to get the Excel sheet like that?

Please help me .

Thanks&Regards
Sridevi

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sridevi,

as far as i know, it's not possible to create such a complex Excel-File with JavaScript. This example shows a typical usage of JSON to CSV conversion: JSON to CSV Converter

If you want to create an Excel-File with additional meta-data or layout-information, you have to implement this with a server-side technology e.g with ABAP.: Excel with SAP - An overview

Regards Michael