Upload JasperReports .jrxml templates and generate PDF, XLSX, DOCX, HTML and CSV reports via API.
released October 25, 2026
npm install strapi-plugin-jasper-reportUpload JasperReports .jrxml templates in the Strapi admin and generate PDF, XLSX, DOCX, HTML and CSV reports through an API.
java.
It is found via, in order: the javaPath option, $JAVA_HOME/bin/java, then java on the PATH.npm install strapi-plugin-jasper-reportThe plugin is enabled automatically, so no configuration is needed. Optional settings go in config/plugins.js:
module.exports = {
'jasper-report': {
config: {
// javaPath: '/usr/lib/jvm/java-17/bin/java', // only if Java is not found automatically
// timeoutMs: 60000,
// maxTemplateSize: 5 * 1024 * 1024,
// jdbc: { url: 'jdbc:postgresql://host:5432/db', user: 'u', password: 'p' }, // default: the Strapi database
},
},
};Rebuild the admin (npm run build) and restart Strapi.
.jrxml.generate, or create an API token.curl -X POST http://localhost:1337/api/jasper-report/generate/<slug> \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{
"format": "pdf",
"parameters": { "title": "Monthly sales" }
}' --output report.pdf| Body field | Description |
|---|---|
format | pdf (default), xlsx, docx, html, csv |
parameters | Object of report parameters; converted to the type declared in the .jrxml (dates as ISO strings) |
Templates must contain a SQL query; templates without one are rejected on upload and never run. The query runs through JDBC against the Strapi database. With PostgreSQL the Strapi connection settings are used automatically; for other databases set jdbc: { url, user, password } (you must add the matching JDBC driver jar to server/java/v6/lib and server/java/v7/lib).
The /generate route is a normal content-API route, so it is protected by Strapi roles and API tokens.
Two engines are bundled: JasperReports 7.1 (templates saved by Jaspersoft Studio 7) and 6.21 (older Studio versions). On upload each template is compiled with 7 first, then 6, and the engine that works is remembered for that template. Add extra JDBC drivers to server/java/v6/lib and server/java/v7/lib.
DOCTYPE/ENTITY are rejected.Plugin: MIT. Bundled libraries: JasperReports (LGPL-3.0), Apache POI and others (Apache-2.0), PostgreSQL JDBC (BSD-2). See server/java/v6/lib and server/java/v7/lib.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
