Coder Social home page Coder Social logo

spring-boot-birt's Introduction

spring-boot-birt

A simple BIRT Rendition Engine

CircleCI GitHub issues GitHub license

Run the Application

To run the applicatin, use the gradle wrapper (gradlew), which will download a Gradle Runtime and start the run task. If you have Gradle installed you can run the run task without the wrapper.

gradlew run

Alternatively you can create an uber-jar using the task installBootDist.

gradlew installBootDist

and run the report application using the ~/birt/build/install/birt-boot/bin/birt script.

You can even execute the jar: java -jar birt-0.0.1.jar from either ~/birt/build/install/birt/lib or ~/birt/build/install/birt-boot/lib directory.

Overwrite the bundled properties in one of the following ways as described in the Spring.io documentation:

  • Environment Variable
BIRT_REPORT_PARAMS_DATASET='{ "firstname": "Max", "lastname": "Schremser", "company": "Microsoft" }' java -jar birt/build/install/birt-boot/lib/birt-0.0.1.jar
  • Java System Property
java -Dbirt.report.params.dataSet='{ "firstname": "Max", "lastname": "Schremser", "company": "Amazon" }' -jar birt/build/install/birt-boot/lib/birt-0.0.1.jar
  • Command line argument
java -jar birt/build/install/birt-boot/lib/birt-0.0.1.jar --birt.report.params.dataSet='{ "firstname": "Max", "lastname": "Schremser", "company": "Google" }'
  • External Properties file
java -jar birt/build/install/birt-boot/lib/birt-0.0.1.jar --spring.config.name=ms

or any different environment.

Instead of setting the report parameter dataset in JSON format, the parameters for firstname, lastname and company can be set to form the JSON object.

gradlew -Dbirt.report.param.firstname=Max -Dbirt.report.param.lastname=Schremser -Dbirt.report.param.company=IBM run

Birt Report (simple.rptdesign)

You can run the Report from within Birt Designer using the Default values. When running the spring boot application the report parameters are taken from the birt.properties file.

Data Source (dataSource)

The Data Source is the source for the data. It has two Script methods:

  • open()
  • close()

open()

Here we create a dataSource Object using the JSON syntax. The boolean moreData is used to exit the fetch() method. If you do not return from the fetch() method, the report render task will not finish.

dataSource = {"firstname": "Matt", "lastname": "Groening", "company": "Netflix"};
moreData = true

close()

The close method frees up the resources.

dataSource = null

Data Set (dataSet)

The Data Set (row) that holds the Column values. We implement the tree methods:

  • open()
  • close()
  • fetch()

open()

moreData = true

close()

moreData = false

fetch()

Copies the values from the Data Source into the Data Set Row. Only 1 row. The values can also be calculated or fetched using Java. For more information on using Java classes for Birt's Rhino Engine look here: github.com/kstojanovski/birt

if (!moreData)
  return false;

row["firstname"] = dataSource.firstname;
row["lastname"] = dataSource.lastname;
row["company"] = dataSource.company;

moreData = false;
return true;

spring-boot-birt's People

Contributors

maxschremser avatar

Watchers

 avatar  avatar

Forkers

siyaooay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.