Reporting and JSF. Possibilities, solutions, challenges. Slide 1. Copyright 2009, Andy Bosch, www.jsf-portlets.net



Similar documents
How to Easily Integrate BIRT Reports into your Web Application

CrownPeak Java Web Hosting. Version 0.20

Complete Java Web Development

In this chapter, we lay the foundation for all our further discussions. We start

The Oracle Fusion Development Platform

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

JasperServer Localization Guide Version 3.5

Open Source Business Intelligence Intro

This presentation will provide a brief introduction to Rational Application Developer V7.5.

Building Web Applications, Servlets, JSP and JDBC

Jaspersoft APIs. Integrating BI with your Applications. Community and Professional Editions

JBoss SOAP Web Services User Guide. Version: M5

An introduction to creating JSF applications in Rational Application Developer Version 8.0

Developing XML Solutions with JavaServer Pages Technology

Rapid Application Development. and Application Generation Tools. Walter Knesel

<Insert Picture Here> Betting Big on JavaServer Faces: Components, Tools, and Tricks

Consuming and Producing Web Services with WST and JST. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Copyright 2014 Jaspersoft Corporation. All rights reserved. Printed in the U.S.A. Jaspersoft, the Jaspersoft

How To Build A Business Intelligence Suite On Java (Bio)

Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

Portals, Portlets & Liferay Platform

Internet Engineering: Web Application Architecture. Ali Kamandi Sharif University of Technology Fall 2007

Liferay Reporting portlet

Consuming and Producing Web Services with Web Tools. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish. Ludovic Champenois Oracle Corporation

JBoss Portlet Container. User Guide. Release 2.0

Reporting and Visualization of Healthcare Data Using Open Source Technology. Virgil Dodson, Actuate

Ernesto Ongaro BI Consultant February 19, The 5 Levels of Embedded BI

Server side PDF generation based on L A TEX templates

Web Application Development

Actuate Business Intelligence and Reporting Tools (BIRT)

Install guide for Websphere 7.0

Web Applications. Originals of Slides and Source Code for Examples:

Building Open-Source Based Architecture of Enterprise Applications for Business Intelligence

Tutorial: Building a Web Application with Struts

An Introduction to the JasperSoft Business Intelligence Suite

Embed BA into Web Applications

Web Frameworks and WebWork

Modern Software Development Tools on OpenVMS

Preface. Motivation for this Book

Oracle Application Development Framework Overview

Creating Java EE Applications and Servlets with IntelliJ IDEA

Books-by-Users Web Development with SAS by Example (Third Edition) Frederick E. Pratter

DTS Web Developers Guide

OpenReports: Users Guide

<Insert Picture Here> Building a Complex Web Application Using ADF and Siebel

Do you know how your TSM environment is evolving?

Apache Jakarta Tomcat

Embed BA into Web Applications

Web Development with the Eclipse Platform

How To Write A Web Framework In Java

BIRT Application and BIRT Report Deployment Functional Specification

Crystal Reports for Eclipse

White Paper. JavaServer Faces, Graphical Components from Theory to Practice

Programming on the Web(CSC309F) Tutorial: Servlets && Tomcat TA:Wael Aboelsaadat

Michelle Metzger TLG Learning. Support:

Volume 1: Core Technologies Marty Hall Larry Brown. An Overview of Servlet & JSP Technology

2012 LABVANTAGE Solutions, Inc. All Rights Reserved.

An Oracle White Paper May Creating Custom PDF Reports with Oracle Application Express and the APEX Listener

Generating Open For Business Reports with the BIRT RCP Designer

OSAS version 8.0 A foundation for the future

Web Application Architecture (based J2EE 1.4 Tutorial)

Struts Tools Tutorial. Version: M5

IBM Rational Web Developer for WebSphere Software Version 6.0

Communiqué 4. Standardized Global Content Management. Designed for World s Leading Enterprises. Industry Leading Products & Platform

Technical White Paper The Excel Reporting Solution for Java

Getting Started with Web Applications

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline

<Insert Picture Here> Oracle Mobile Enterprise Application Platform Overview

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

An Overview of Servlet & JSP Technology

ULTIMATE GUIDE. Jaspersoft ireport Designer

Server Setup and Configuration

Credits: Some of the slides are based on material adapted from

Michael Bösch. EDV-Consulting. Dipl. Informatiker (FH)

HPC Portal Development Platform with E-Business and HPC Portlets

Quick start. A project with SpagoBI 3.x

Aspose.Cells Product Family

Business Process Management IBM Business Process Manager V7.5

SAP NetWeaver Opens SAP ERP world. Amedeo Prodi SAP Italia

Generate Android App

Java Web Services Developer Pack. Copyright 2003 David A. Wilson. All rights reserved.

Jaspersoft Business Intelligence Suite

What Is NetBeans? Free and open-source based > Open source since June, 2000 > Large community of users and developers

Developing Web Applications using JavaServer Pages and Servlets

Welcome The webinar will begin shortly

JVA-122. Secure Java Web Development

Mastering Tomcat Development

Data Crow Creating Reports

Practical Eclipse Rich Client Platform Projects

JSP Java Server Pages

Maps & Directions App

Building and Using Web Services With JDeveloper 11g

Transcription:

Reporting and JSF Possibilities, solutions, challenges Slide 1

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 2

Who am I? Name: Andy Bosch Trainer, Coach, Developer, Specialized on JSF und Portlets Expert Group member of JSR-301 and JSR-329 Editor of www.jsf-forum.de and www.jsf-portlets.net Working with JSF since 2004 Slide 3

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 4

What is reporting? Monthly contracts January 31 February 28 March 34 April 22 May 17 June 29 Slide 5

From data to knowledge Costs Plain data Information Data and additional meaning Knowledge Information which can be analyzed Only characters and numbers Benefit Slide 6

Where to find the data? Slide 7

Once upon a time Boss: I need some figures about our last month sales. It s very urgent. Developer: Uh, I can write a sql script which collects all the data, but it will take about 2 hours Boss: But you did it last month, right? Developer: Yes, I will see if I can find the sql again in my waste bin Boss: And please don t forget to create a nice looking chart! Developer: Really?. I hate MS-Excel Is there any way you can do this on your own? Boss: No, I don t understand SQL. Please do take care of it. Slide 8

Reporting Engines done by yourself - Using itext or Xslt (Apache Fop) - Jakarta POI or JExcelAPI Pros - Easy to create simple solutions - Good for smaller requirements Cons - Only a programmer can change the report design - Everything is done in the Java source code - Limited only to Pdf or Excel as output format - Many many lines of code Slide 9

We need a real reporting solution - A reporting engines helps you to create reports. - A reporting engines helps you to visualize your reports. - You can see up-to-date reports again and again. - You have to invest time and knowledge only once to create good-looking and meaningful reports - When integrated in a web application, customers can view the reports within their familiar environment. Slide 10

BI, MIS, DSS Reporting is not cutting edge. Terms in ealier times: - MIS: Management Information Systems - DSS: Decision Support Systems - EIS: Executive Information Systems - BI: Business Intelligence Slide 11

The goal: Reports integrated in JSF apps - Web application - UI is based on JSF - User should be able to view reports inside the web application - Reports shouldn t be hard coded. - User should be able to add additional reports. Slide 12

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 13

Do you all know JSF? JavaServer Faces is a framework. It is not a ready-to-use product, just a framework which offers the possibility to build web applications. A framework usually includes best practices. JavaServer Faces is focused on the user interface. JavaServer Faces is a standard JSF is standardized via the JCP (Java Community Process). Since JSF 1.2 it is part of the Java Enterprise Edition. Slide 14

Main concepts within JSF Bean management Navigation rules / definition of page flows Conversion and input validation Event handling Lifecycle... Slide 15

And: Powerful UI components Slide 16

Our example web application Small web application for a company s inventory management. You can enter new inventory data. You can remove items from the inventory list. And of course you can see reports on your inventory. Two solutions JSF 1.2 and JSPs JSF 2.0 and Facelets Slide 17

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 18

Reporting engines Do you need a reporting engine? Fine, how many millions do you have as budget? That s not true any more. There are plenty of good OpenSource solutions available. Slide 19

Reporting and OpenSource Quick Google search: More than 50 projects about reporting Big and very well-know ones (and the ones where I have some personal experience ) Eclipse BIRT JasperReports Slide 20

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 21

The Eclipse BIRT project BIRT = Business Intelligence and Reporting Tools Top level project within Eclipse Foundation OpenSource Offers a framework for reporting and business intelligence for web applications and rich clients Slide 22

Eclipse BIRT: History Founded by Actuate Corporation In 2004: Moved to the Eclipse Foundation, then became OpenSource Still an active community http://www.birt-exchange.com Actuate offers professional services and additional products Slide 23

Eclipse BIRT: General overview Slide 24

Eclipse BIRT: IDE Slide 25

Part 1: Creating a BIRT report definition 1. Create a BIRT report project 2. Assign a datasource 3. Create a dataset 4. Create your report (including chart) 5. Preview and test your report 6. View it in pdf/html/ Slide 26

BIRT Report definitions BIRT reports are stored in *.rptdesign files Xml file Report files can be included in applications A runtime engine is needed to display the reports Slide 27

Part 2: Viewing the results Slide 28

Demonstration of BIRT Slide 29

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 30

JasperReports According to the Website: JasperReports is the world's most popular open source Java reporting library Open Source Company behind : JasperSoft Part of the JasperSoft Business Intelligence Suite (commercial) Completely written in Java Can generate Pdf, Html, Xls, CSV, Xml, Slide 31

Based on existing libraries Various Jakarta Commons libs Jakarta POI and JExcel API itext JFreeChart Slide 32

JasperReports additional tools ireport Designer (free) JasperServer JasperAnalysis (OLAP) JasperETL Slide 33

JasperReports report template - Again XML - To be more precisly JRXML <jasperreport name="simple_report"> <detail> <band height="20"> <statictext> <reportelement x="180" y="0" width="200" height="20"/> <text><![cdata[hello World!]]></text> </statictext> </band> </detail> </jasperreport> Slide 34

JasperReports previewing the template - In the download package, there are some ant tasks to preview a template ant viewdesignxml - net.sf.jasperreports.view.jasperdesigner - Small swing application which displays the jrxml files Slide 35

From *.jrxml to *.jasper - Report files are compiled to *.jasper files Slide 36

Generating a Jasper report To produce reports, you need at least: - Report template (compiled) - Parameters - Data source Result is a document (pdf, html, ) Slide 37

ireport report designer for JasperReports Visual report designer Free and Open Source Available for various operating systems Slide 38

ireport IDE Slide 39

Demonstration of JasperReports Slide 40

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 41

Integrating BIRT BIRT-Runtime (1) WebViewer Webapplication (2) WebViewer and Taglib (3) BIRT APIs Slide 42

WebViewer web application 1. Deploy birt.war 2. Add commons-logging 3. Copy report file into the birt-folder 4. Add your database driver (library) 5. Call a birt url http://localhost:8080/birt/frameset? report=myreport.rptdesign Slide 43

WebViewer - Options Frameset Fully fledged report Menus Paging Run Only report without decoration Slide 44

Combination with JSF? IFrame When clicking on a button or link, you can open an overlay iframe Popup Open a new popup window where the report is created Slide 45

WebViewer and taglib 1. Create a new web application 2. Include birt.tld (e.g. WEB-INF/tlds) 3. Edit web.xml to let your tld know 4. Include necessary jars in your WEB-INF 5. Create JSP-pages using the BIRT-taglib <birt:viewer id="birtviewer" reportdesign="reportforjsf.rptdesign" format="html" ishostpage="false" baseurl="/birt"> </birt:viewer> Slide 46

JSF tags provided by JBoss SEAM Using the SEAM framework and JBoss Tools, there are specialized JSF tags for including BIRT <p:birt designtype="embed" masterpage="false" embeddable="true" designname="rpy.rptdesign" > <p:param name="myparam" value="myvalue"/> </p:birt> Slide 47

Combination with JSF? Create a JSF application Do the same steps as mentioned before Write a JSF page with included JSP tags - Combine JSF and JSP tags - or use the tags provided by SEAM Slide 48

Using the BIRT APIs It is also possible to use the BIRT APIs The API is very powerful You can control nearly everything by the APIs By using the APIs, you can create a report within your application Slide 49

Using the BIRT APIs - example Platform.startup( config ); IReportEngineFactory factory =...; engine = factory.createreportengine(config); IReportRunnable design = null; design = engine.openreportdesign("jsf.rptdesign"); IRunAndRenderTask task = engine.createrunandrendertask(design); HTMLRenderOption options = new HTMLRenderOption(); options.setoutputstream( resp.getoutputstream() ); options.setoutputformat( "html" ); task.setrenderoption(options); task.run(); Slide 50

Combination with JSF? Redirect from a JSF call to a BIRT servlet Use Facelets to include a servlet into a page Within the servlet, use the API to generate your report Slide 51

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 52

Jasper and JSF Create an output file (pdf, xls,..) and display it Building a servlet which generates html Popup / IFrame Slide 53

Jasper and JSF byte[] bytes = JasperRunManager.runReportToPdf(... ); HttpServletResponse response = (HttpServletResponse)facesContext.getExternalContext().getResponse(); ServletOutputStream servletoutputstream = response.getoutputstream(); servletoutputstream.write(bytes, 0, bytes.length); servletoutputstream.close(); FacesContext.getCurrentInstance().responseComplete(); Slide 54

Agenda What is reporting? Why do we need it? The JSF example application Introduction to reporting engines Overview Eclipse BIRT JasperReports Integration into JSF Eclipse BIRT JasperReports Conclusion Slide 55

Conclusion There are some really good (Open Source) reporting engines available Both BIRT and Jasper separate the design phase from the runtime phase For viewing reports in a web page there are various ways to do this There is no real integration into JSF, but several ways to realize this yet. But still: It works!!! Slide 56

Any questions? German pages: www.jsf-forum.de English pages: www.jsf-portlets.net Or send an email to andy.bosch@jsf-portlets.net Slide 57