The official Grails Export Plugin.
This plugin offers export functionality supporting different formats e.g. CSV, Excel (xls, xlsx), Open Document Spreadsheet, PDF and XML and can be extended to add additional formats.
The user guide can be found here: 📚 Documentation
This was previously forked from Nathan Wells
Add the following dependency to the build.gradle file:
dependencies {
implementation("io.github.gpc:grails-export:8.0.0-RC1")
}
Grails 8 has three lines of this plugin. They differ only in the PDF, RTF and Excel libraries they bring with them (and which your application gets too); the plugin's own tags, exporters and parameters are the same in all three.
| Line | Branch | Status | Apache POI | OpenPDF / OpenRTF | OpenPDF package |
|---|---|---|---|---|---|
| 8.0 | 8.0.x |
current | 5.5 | 1.4 / 1.2 | com.lowagie |
| 8.1 | 8.1.x |
in development, to be released with Grails 8.1 | 6.0 | 2.4 / 2.0 | com.lowagie |
| 9.0 | 9.0.x |
in development | 6.0 | 3.0 / 3.0 | org.openpdf, org.openrtf |
What changes for an application, if it uses these libraries itself:
- 8.0 → 8.1: Apache POI 6 and OpenPDF 2. Every POI module the application declares (
poi-scratchpad, for example) must move to 6.0 as well. OpenPDF 2.0 removed 108 methods and fields deprecated in 1.3.40, so code using one of them must use its replacement (OpenPDF 2.0.0 release notes). - 8.1 → 9.0: OpenPDF 3 and OpenRTF 3 move their classes out of
com.lowagie, so application code importingcom.lowagie.text.*changes its imports toorg.openpdf.text.*(andcom.lowagie.text.rtf.*toorg.openrtf.text.rtf.*).
An application that only uses the plugin's tags and exportService needs no changes between them.
Snapshots of each line (8.0.0-SNAPSHOT, 8.1.0-SNAPSHOT, 9.0.0-SNAPSHOT) are published from its branch to the
Sonatype snapshot repository:
repositories {
maven {
url = 'https://central.sonatype.com/repository/maven-snapshots/'
mavenContent { snapshotsOnly() }
content { includeGroup('io.github.gpc') }
}
}
dependencies {
implementation("io.github.gpc:grails-export:7.1.0")
}
dependencies {
implementation("org.grails.plugins:export:2.0.0")
}
dependencies {
compile("org.grails.plugins:export:2.0.0")
}