Requirement
A couple of days ago there was a about excel export for WD! in Web Dynpro Forum to translate table data to Excel file. The quick answer was to refer to Web Dynpro Binary Cache. However, the requirement was to change font of header, change the colour of the cell etc.. Basically to have an MS-Excel sheet, rather than using the conventional approach of translating data to XML Format or CSV Format.Therefore our toExcelUsingXML() or toExcelUsingCSV() approach will not help in this case.
There are Assessment for Excel Solutions in Java to do this. I used the jexcelapi which enables us to achieve this.
Pre-Requisites
- Web Dynpro Binary Cache
Setup
- Make sure you also add the jxl.jar file to the library as well
Implementation
wdDoInit
getCachedWebResource
Context Variables
Create a variable ExcelUrl in the context. This variable will hold the location of the Excel sheet
Output
Output Page
Excel sheet
For more information regarding formatting refer the tutorial available with jexcelapi.