All Projects → alejandro-du → report-ui

alejandro-du / report-ui

Licence: Apache-2.0 license
Generate Jasper Reports from your entities/beans/POJOs.

Programming Languages

java
68154 projects - #9 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to report-ui

vaadin-board
Web Component for creating flexible responsive layouts and building nice looking dashboards.
Stars: ✭ 17 (+21.43%)
Mutual labels:  vaadin
java-pwa
Progressive Web Apps in Java
Stars: ✭ 48 (+242.86%)
Mutual labels:  vaadin
multiselect-combo-box
A multi select combo box web component based on Polymer and the vaadin-combo-box
Stars: ✭ 41 (+192.86%)
Mutual labels:  vaadin
GeoFuse
Thematic Engine for Dynamic CSV or Tab Delimited Data
Stars: ✭ 15 (+7.14%)
Mutual labels:  vaadin
crawling-framework
Easily crawl news portals or blog sites using Storm Crawler.
Stars: ✭ 22 (+57.14%)
Mutual labels:  vaadin
testbench
Vaadin TestBench is a tool for automated user interface testing of Vaadin Framework applications.
Stars: ✭ 20 (+42.86%)
Mutual labels:  vaadin
microservices4vaadin
Sample application to show the secured integration of microservices and vaadin
Stars: ✭ 30 (+114.29%)
Mutual labels:  vaadin
base-starter-flow-quarkus
A project base/example for using Vaadin with Quarkus
Stars: ✭ 23 (+64.29%)
Mutual labels:  vaadin
PagedTable
PagedTable Add-on for Vaadin Framework 8
Stars: ✭ 19 (+35.71%)
Mutual labels:  vaadin
StockManager
a JavaFX stock manager app
Stars: ✭ 29 (+107.14%)
Mutual labels:  jasperreports
vaadin-dialog
High quality web component for modal dialogs. Part of the Vaadin platform.
Stars: ✭ 15 (+7.14%)
Mutual labels:  vaadin
flow-and-components-documentation
The documentation for the Vaadin framework version 10+
Stars: ✭ 16 (+14.29%)
Mutual labels:  vaadin
spring-javafx-material-design-admin
Aplicação desktop para Gerenciamento de estoque e vendas com Spring Boot, JavaFX e Material Design
Stars: ✭ 56 (+300%)
Mutual labels:  jasperreports
tutorial
Introduction to Vaadin
Stars: ✭ 58 (+314.29%)
Mutual labels:  vaadin
vaadin-context-menu
The responsive Web Component for showing context dependent items for any element on the page. Part of the Vaadin components.
Stars: ✭ 26 (+85.71%)
Mutual labels:  vaadin
owlcms4
Olympic Weightlifting Competition Management System
Stars: ✭ 41 (+192.86%)
Mutual labels:  vaadin
elasticsearch-report-engine
An Elasticsearch plugin to return query results as either PDF,HTML or CSV.
Stars: ✭ 49 (+250%)
Mutual labels:  jasperreports
maven-springboot-electron
Package your Java Web Application with Electron + OpenJDK only using Maven
Stars: ✭ 44 (+214.29%)
Mutual labels:  vaadin
material-theme-fw8
Material design theme for Vaadin Framework 8
Stars: ✭ 23 (+64.29%)
Mutual labels:  vaadin
vaadin-demo-bakery-app
This project contains the source code generated by Vaadin's Starter Pack (Bakery App/Spring)
Stars: ✭ 43 (+207.14%)
Mutual labels:  vaadin

Published on Vaadin  Directory Stars on Vaadin Directory Latest version on vaadin.com/directory

Report UI Add-on provides an easy way to render JasperReports in Vaadin applications through DynamicJasper.

Basic usage

Say, you have the following domain/entity/Java Bean class:

public class Call {

    private Long id;
    private String client;
    private String phoneNumber;
    private City city; // enum
    private LocalDateTime startTime;
    private Integer duration;
    private Status status; // enum

    ... getters and setters ...
}

 

You can create a new report and add it to any Vaadin layout as follows:

PrintPreviewReport<Call> report = new PrintPreviewReport<>(Call.class);
report.setItems(Repository.findAll());
layout.addComponent(report);

 

Advanced usage

You can optionally set the order of the columns as follows:

PrintPreviewReport<Call> report = new PrintPreviewReport<>(Call.class, "client", "city", "phoneNumber", "startTime", "duration", "status");

 

If you prefer, you can use the default constructor to avoid creating the columns automatically. In that case, you can use the getReportBuilder() method to set the columns manually:

PrintPreviewReport<Call> report = new PrintPreviewReport<>();
report.getReportBuilder()
        .setMargins(20, 20, 40, 40)
        .setTitle("Call report")
        .addAutoText("For internal use only", AutoText.POSITION_HEADER, AutoText.ALIGMENT_LEFT, 200, headerStyle)
        .addAutoText(LocalDateTime.now().toString(), AutoText.POSITION_HEADER, AutoText.ALIGNMENT_RIGHT, 200, headerStyle)
        .addAutoText(AutoText.AUTOTEXT_PAGE_X_OF_Y, AutoText.POSITION_HEADER, AutoText.ALIGNMENT_RIGHT, 200, 10, headerStyle)
        .setPrintBackgroundOnOddRows(true)
        .addColumn(city = ColumnBuilder.getNew()
                .setColumnProperty("city", City.class)
                .setTitle("City")
                .build())
        .addGroup(new GroupBuilder()
                .setCriteriaColumn((PropertyColumn) city)
                .build())
        .addColumn(ColumnBuilder.getNew()
                .setColumnProperty("client", String.class)
                .setTitle("Client")
                .build())
        .addColumn(ColumnBuilder.getNew()
                .setColumnProperty("phoneNumber", String.class)
                .setTitle("Phone number")
                .build())
        .addColumn(ColumnBuilder.getNew()
                .setColumnProperty("startTime", LocalDateTime.class)
                .setTitle("Date")
                .setTextFormatter(DateTimeFormatter.ISO_DATE.toFormat())
                .build())
        .addColumn(ColumnBuilder.getNew()
                .setColumnProperty("startTime", LocalDateTime.class)
                .setTextFormatter(DateTimeFormatter.ISO_LOCAL_TIME.toFormat())
                .setTitle("Start time")
                .build())
        .addColumn(ColumnBuilder.getNew()
                .setColumnProperty("duration", Integer.class)
                .setTitle("Duration (seconds)")
                .build())
        .addColumn(ColumnBuilder.getNew()
                .setColumnProperty("status", Status.class)
                .setTitle("Status").build());

 

See the DynamicJasper documentation for more configuration examples.

You can get a StreamResource for downloading the report in various formats. For example:

StreamResource streamResource = report.getStreamResource(
        "report.pdf", itemsSupplier, PrintPreviewReport.Format.PDF);
Anchor pdf = new Anchor(streamResource, "Download PDF");

 

Apache POI is required when using some of the exporting methods:

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.10-FINAL</version>
</dependency>

 

In order to render charts you have to configure an ImageServlet. For example:

@WebServlet("/report-image")
public static class ReportsImageServlet extends ImageServlet {
}

You can configure the URL pattern using the setImageServletPathPattern method (default to report-image?image={0}).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].