integrating jasperreports with webobjects

20
Integrating JasperReports with WebObjects Kieran Kelleher WOWODC 2010 Montreal Green Island Consulting LLC SmartleadsUSA LLC SmartMix Technologies LLC Friday, September 3, 2010

Upload: wo-community

Post on 11-Nov-2014

1.910 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Integrating JasperReports with WebObjects

Integrating JasperReports with WebObjectsKieran Kelleher WOWODC 2010 MontrealGreen Island Consulting LLCSmartleadsUSA LLCSmartMix Technologies LLC

Friday, September 3, 2010

Page 2: Integrating JasperReports with WebObjects

• Overview of JasperReports

• High Level Overview of Report Generation

• JasperReports Architecture & Dependencies

• WebObjects Integration

• Developing a Report

• Running a Report

Objectives

Friday, September 3, 2010

Page 3: Integrating JasperReports with WebObjects

• http://jasperforge.org/projects/jasperreports

• “world's most popular open source reporting engine.”

• “entirely written in Java”

• “use data coming from any kind of data source”

• “produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word.”

What is ?

Friday, September 3, 2010

Page 4: Integrating JasperReports with WebObjects

Feature Highlights• Pixel-perfect page-oriented or continuous output for web or print

• Traditional tabulated data, multi-level grouping and data aggregating by group

• Dashboards, tables, crosstabs, charts and gauges

• Report output in PDF, XML, HTML, CSV, XLS, RTF, TXT

• Integrated barcode support

• No limit to report size

• Conditional printing

• Sub-reports handle highly complex layouts

• Multiple data sources of multiple kinds in one report

• Internationalized and Localizable

• etc., etc.

Friday, September 3, 2010

Page 5: Integrating JasperReports with WebObjects

Flexible Data Sources

• JRDataSource interface

• Database JDBC connection

• File CSV data source

• XML file data source

• etc., etc., etc.

• Custom JRDataSource

• KeyValueCoding objects

Friday, September 3, 2010

Page 6: Integrating JasperReports with WebObjects

Development

Overview of Report Generation

Runtime

JRDataSource

JasperReports Engine Report

Report Properties HashMap

Friday, September 3, 2010

Page 7: Integrating JasperReports with WebObjects

JasperReports Architecture Dependencies

iText JFreeChart Apache POI Apache Commons ... and more...

JasperReports

Jaxen-1.1.1 jpa.jar jxl-2.6.jar png-encoder-1.5 barcode4j-2.0

Friday, September 3, 2010

Page 8: Integrating JasperReports with WebObjects

ERJasperReports

iText 2.1.7 JFreeChart 1.0.12 Apache POI 3.5 Apache Commons(various) ... and more...

JasperReports 3.7.4

ERJasperReports

Jaxen-1.1.1 jpa.jar jxl-2.6.jar png-encoder-1.5 barcode4j-2.0

Friday, September 3, 2010

Page 9: Integrating JasperReports with WebObjects

What is in ERJasperReports

• jar libs for JasperReports and its essential dependencies

• Custom JRDataSource for array or enumeration of KVC objects.

• java.util.concurrent.Callable task operating on a EOFetchSpec

• Convenience utility method for calling JR.

• Add the framework to your project. Has Wonder dependency

• Not yet committed to Wonder :-(

• Should be within a week :-)

Friday, September 3, 2010

Page 10: Integrating JasperReports with WebObjects

Planned Improvements

• Batching and EOEditingContext recycling for huge data-sets.

• API for subreports

• Planned before end of the year

Friday, September 3, 2010

Page 11: Integrating JasperReports with WebObjects

“Quick” Test-Drive

• DEMO

Friday, September 3, 2010

Page 12: Integrating JasperReports with WebObjects

ERJasperReports Usage - Typical Logic

Run Background Task

Create the EOFetchSpecification

Optionally create the Parameters HashMap

CreateLongResponse Page

CreateERJasperReportTask

Pre-Requisites

1. report.jasper file in Resources

2. ERJasperReports in the classpath

Download the Report

Friday, September 3, 2010

Page 13: Integrating JasperReports with WebObjects

Report Design Tool

• iReport.app

• http://sourceforge.net/projects/ireport/files/

• iReport.dmg installer for OS X

• IMPORTANT: iReport version must match JasperReports

• JasperReports dist bundled inside iReport.app

• Current version is 3.7.4

Friday, September 3, 2010

Page 14: Integrating JasperReports with WebObjects

iReport.app

Report Designer

Elements Palette

Property Sheet

Styles

ReportInspector

ProblemsConsole

Friday, September 3, 2010

Page 15: Integrating JasperReports with WebObjects

Demo

• Designing a Report with iReport.app

• Example WebObjects app using JasperReports

Friday, September 3, 2010

Page 16: Integrating JasperReports with WebObjects

Beta Project Repository

• http://montreal2010.googlecode.com/svn/trunk/

• ERJasperReports

• Wonder dependency

• ERExtensionsIncubator (temporary)

• ERJasperReportsExample

• ERJasperReports and its dependencies

• WKDemoReusable (temporary - to be merged into example)

Friday, September 3, 2010

Page 17: Integrating JasperReports with WebObjects

Example Setup• Wonder needs to be installed

• svn checkout from http://montreal2010.googlecode.com/svn/trunk/

• ERJasperReports

• ERExtensionsIncubator

• ERJasperReportsExample

• WKDemoReusable

• ERMoviesLogic database setup

• ERJasperReportsExample/Documentation/README.txt

Friday, September 3, 2010

Page 18: Integrating JasperReports with WebObjects

Documentation

• Best available (IMHO), to get you started...

• “jasper Reports 3.5 for Java Developers” - amazon.com

• Also....

• JasperForge.org (you probably need a free account)

• intros, tutorials, forum, etc.

• Down load source. See readme.txt, demo, dist/javadoc,

Friday, September 3, 2010

Page 19: Integrating JasperReports with WebObjects

Resources

• http://sourceforge.net/projects/jasperreports/files/jasperreports

• http://sourceforge.net/projects/ireport/files/

• http://jasperforge.org/

• *Temporary Repository for Beta Project*

• http://code.google.com/p/montreal2010/source/checkout

Friday, September 3, 2010

Page 20: Integrating JasperReports with WebObjects

Q&AIntegrating JasperReports with WebObjectsWOWODC 2010

Friday, September 3, 2010