Skip to content

ZaTribune/springboot-jasperreports-advanced-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

108 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring

spring
jasperreports

SpringBoot Reporting Service

A powerful demo project for generating dynamic reports using JasperReports Libraries & Spring Boot.

📊 Code Coverage

Instruction Coverage Line Coverage Branch Coverage Complexity Coverage Method Coverage Class Coverage Overall Coverage

Built with

  • Java (JDK 17 or later).
  • Jasperreports.
  • TIBCO Jaspersoft Studio (Community Edition).
  • LibreTranslate : Free and Open Source Machine Translation API.

Features

  • 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) and RTL (Right-to-Left) languages like English and Arabic.
  • Output Formats: Supports multiple formats, including PDF, XLS, CSV, and HTML.
  • Code Coverage: This project uses JaCoCo for code coverage and GitHub Actions to generate and display the coverage percentage directly in this README.

Steps to deploy

  • 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 .jrxml file. This file will be compiled later (during runtime) to a .jasper file.
  • 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 local profile.

First Example

  • 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:,

    overview

Second Example

  • The second example v2 is for direct filling with field translation;
  • Also, two samples {receipt_en, receipt_ar} are provided.

Testing

  • 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.

Preview

report_english report_arabic

Notes

  • Numeric values used on the project are Integer, Double.
  • BigDecimal values are rendered as String within jrxml files.

License

This project is licensed under the MIT License – see the LICENSE file for details.

Acknowledgments

  • 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.

Authors

Linkedin

About

A demo project for a reporting service built with jasperreports & spring boot with advanced features.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages