background preloader

Java

Facebook Twitter

PrimeFaces. Community. JSF + JPA + JasperReports (iReport) Part 1. Hi in this post we will see the overview of JasperReports and how to integrate into JSF application.

JSF + JPA + JasperReports (iReport) Part 1

JasperReports is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word. In Primeface library also use this JasperReports to generate the PDF, CSV and DOC formats with single line of code. see here. but its not flexible and we cant change template. so here we see the how to use JasperReports for create the template and integrate JSF 2.0.

We are using iReport tool for crating template. JSF + JPA + JasperReports (iReport) Part 2. In this post is a continuation of Jasper Report Part 1. here we will discuss about some advanced jasper report concepts like passing complex object like List, Date object and how to create and use local variable in jasper report, Add the sub-report and background image to report.

JSF + JPA + JasperReports (iReport) Part 2

Check my latest post about Integrate Charts into Jasper Reports. here i am using JPA (Java Persistence API) for accessing the Database. so i create the two entity ShoppingCart and Item. here ShoppingCart entity contain list of Item entities. then i am going to pass these objects to Jasper Report. (Check the video in below) ShoppingCart.java @Entity public class ShoppingCart { @Id @GeneratedValue(strategy= GenerationType.AUTO) private long id; private String firstName; private String lastName; @Temporal(TemporalType.DATE) private Date dop; @OneToMany(cascade= CascadeType.ALL) private List<item> listOfItems; } </item>