Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
miltonc
Product and Topic Expert
Product and Topic Expert
GitHub repository:

 

Introduction:

  • In this session, we will look at how we can download table data in Excel with custom formatting

  • SAPUI5 framework has support for Excel download - but comes with minimal formatting options

  • We can achieve any kind of custom formatting with HTML5, CSS and JavaScript


 


Excel with custom formatting


 

Synopsis:

  • To achieve this custom formatting, we can use HTML5, CSS and JavaScript

  • Basically, we need to manipulate the DOM structure and add an <a> tag to it

  • The href attribute of the <a> tag will hold the outerHTML of the table element

  • And with the help of a simple utility function, we can download the table with custom formatting


 

YouTube Link:

https://youtu.be/Ov5Ga8QTFAc

 

Conclusion:

  • This workaround will allow us to download table data in Excel with custom formatting

  • This workaround is not supported by SAP

  • The Excel file downloaded in this manner will have a warning message

  • If you have questions or comments, please list them below and I will be happy to answer