grailsexport-to-excelgrails-2.4

Grails 2.4.4 How do I export excel file?


I've looked at some plugins but no success. I tried Export Plugin 1.6 as well but the view doesn't recognize r:.. and export:.. tags. What is the best way to export rows of data from postgresql database into an excel file from a click of a button? Thank you.


Solution

  • Did you try directly with apache poi ?

    From the website:

    The Apache POI Project's mission is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft's OLE 2 Compound Document format (OLE2). In short, you can read and write MS Excel files using Java. In addition, you can read and write MS Word and MS PowerPoint files using Java. Apache POI is your Java Excel solution (for Excel 97-2008). We have a complete API for porting other OOXML and OLE2 formats and welcome others to participate.

    EDIT: Here is a tutorial: Read / Write Excel file in Java using Apache POI and a quick guide

    EDIT2: I just found another link using Grails that could help you. The example use another library: jexcelapi