Hi Sakthivel,
I introduced the screenxls type screen to use the spread software functionality to convert a html table to spread table with possibility to indicate the cell format.****
<handler name="exportxls" type="view" class="com.nereide.webapp.ExportXlsViewHandler"/>An others solution also is create your how Handler to create your
export with Apache POI [2] :
Workbook workbook = new XSSFWorkbook(); [...]
response.setContentType(contentType); OutputStream outputStream = response.getOutputStream(); workbook.write(outputStream); outputStream.flush();
*****
[1] https://labs.nereide.fr/10031/plugins/nereideutils/
All, Does Ofbiz support Excel export natively? i see most of the Out of the box exports are using .csv.instead, however i do see an Excel sample in the Example plugin and below is the url to the Ofbiz instance running locally It uses the view-map type as "screenxls", but when the export is complete it does not produce an xls file rather it produces a html response; It may not be a big deal as .csv works as expected and .csv could be saved as .xls or .xlsx, But wanted to check with the community if there is anything missed in the Excel Export to function natively; Thanks for any pointers. <view-map name="ExampleReportXls" type="screenxls" page="component://example/widget/example/ExampleScreens.xml#ExampleReport" content-type="application/vnd.ms-excel"/> https://localhost:9443/example/control/EditExample?exampleId=EX01 <!-- Begin Template component://common-theme/template/includes/Simple.xls.ftl --> <html lang="en-US" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head> <body> <style> .txf { mso-number-format: \@ } .cf { mso-number-format: "\#\#0.00" } .nf { mso-number-format: "0.00" } .tf { mso-number-format: "HH:mm:ss" } .df { mso-number-format: "yyyy-MM-dd" } .dtf { mso-number-format: "yyyy-MM-dd HH:mm:ss" } </style> <table><tr> <td class="txf" >Example ID</td><td class="txf" >EX01</td></tr> <tr> <td class="txf" >Type</td><td class="txf" required>Contrived</td></tr> <tr> <td class="txf" >Status</td><td class="txf" required>In Design</td></tr> <tr> <td class="txf" >Example Name</td><td class="txf" required>Example 1</td></tr> <tr> <td class="txf" >Description</td><td class="txf" ></td></tr> <tr> <td class="txf" >Long Description</td></tr> <tr> <td class="txf" >Comments</td><td class="txf" ></td></tr> <tr> <td class="txf" >Example Size</td><td class="txf" ></td></tr> <tr> <td class="txf" >Example Date</td><td class="dtf" ></td></tr> <tr> <td class="txf" >Another Date</td><td class="dtf" ></td></tr> <tr> <td class="txf" >Another Text</td><td class="txf" ></td></tr> <tr> <td class="txf" ></td></tr> </table> </body> </html> <!-- End Template component://common-theme/template/includes/Simple.xls.ftl -->
Free forum by Nabble | Edit this page |