Skip to content

A demo project for utilizing jasperreports within a spring boot web application with advanced features.

License

Notifications You must be signed in to change notification settings

ZaTribune/springboot-jasperreports-advanced-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring

spring
jasperreports

SpringBoot Reporting Service

A demo project for generating Reports (XLS, PDFs, and so on) using JasperReports & SpringBoot.

codecov

Built with

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

Features

  • There are two models for generating reports.
    • Pre-modeled Reports (with strict validation and mapping).
    • Direct Filling Reports (with translation capability) ~ Also referred to as v2.
  • Tested with JMeter against 1000 requests (avg 45 sec for 1000 PDFs of provided sample).
  • Support for LTR & RTL languages; Given English and Arabic as an example with the same workflow except for data input.
  • Notes for different workflows created as "how to" to help users [in progress].
  • Supported output formats {PDF, XLS, CSV, HTML}.

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.

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 getting translated reposts; Also two samples {receipt_en, receipt_ar} were added.
  • For translation APIs, visit this url to get a free mirror for LibreTranslate.

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 utilize swagger-ui.
  • A console.sql file is added here to validate the db.

Preview

report_english report_arabic

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 utilizing jasperreports within a spring boot web application with advanced features.

Topics

Resources

License

Stars

Watchers

Forks

Languages