- Java (JDK 17 or later).
- Jasperreports.
- TIBCO Jaspersoft Studio (Community Edition).
- LibreTranslate : Free and Open Source Machine Translation API.
- Two Report Generation Models:
- Pre-Modeled Reports: Strict validation and mapping for structured data.
- Direct Filling Reports (v2): Supports translation capabilities for dynamic data.
- Performance: Tested with JMeter for up to 1000 requests, averaging 45 seconds for 1000 PDFs.
- Multilingual Support: Handles both
LTR(Left-to-Right) andRTL(Right-to-Left) languages like English and Arabic. - Output Formats: Supports multiple formats, including
PDF,XLS,CSV, andHTML. - Code Coverage: This project uses JaCoCo for code coverage and GitHub Actions to generate and display the coverage percentage directly in this README.
- Load this project on your preferred IDE, and Maven will load all dependencies and configure directories.
- Every Jasperreports workflow starts with the creation of a template, exported to a
.jrxmlfile. This file will be compiled later (during runtime) to a.jasperfile. - To create these templates easily, you will need to use the Jaspersoft Studio.
- After exporting your templates from the editor, you can insert them here.
- To support multiple languages/locales per record, you will have to create a template for each reportLocale.
- (Optional) You can use the
LibreTranslate API- docs.- Install locally here.
- Run the application in
localprofile.
-
On the first example, I've provided two templates {
invoice_en,invoice_ar} representing the two reportLocale implementations of a report called invoice. -
You will have to follow a certain structure/hierarchy for data input. Adapting this structure helps on injecting and validating report data.
See the following figure:,
- The second example
v2is for direct filling with field translation; - Also, two samples {
receipt_en,receipt_ar} are provided.
- Provided with two testing templates for both types of models, You can use Postman for testing by importing this collections file.
- Also, you can use swagger-ui for reference.
- A console.sql file is added here to validate the db.
- Numeric values used on the project are Integer, Double.
- BigDecimal values are rendered as String within jrxml files.
This project is licensed under the MIT License – see the LICENSE file for details.
- Special thanks to the JasperReports community for providing a powerful reporting library.
- Thanks to the LibreTranslate team for providing a reliable translation service.
- Gratitude to the Spring Boot team for making it easy to integrate with Spring applications.


