Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Basic BIRT Report Development John Ward, Innovent Solutions.

Similar presentations


Presentation on theme: "© 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Basic BIRT Report Development John Ward, Innovent Solutions."— Presentation transcript:

1 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Basic BIRT Report Development John Ward, Innovent Solutions

2 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 2 2 BIRT and us – Who are I? Who are you?  Who are we?  John Ward, BIRT user  Innovent Solutions  Author: Practical Data Analysis and Reporting with BIRT  Who are you?  Name, Company, technical background (C, SQL, Java, reporting…)  Experience with BIRT  What are you hoping to get out of today’s presentation?

3 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 3 Agenda  BIRT Overview  Lesson 1 – Simple Reports  Lesson 2 – Charting in Reports  Lesson 3 – BIRT Scripting  Lesson 4 – Report Libraries and Templates  Lesson 5 – Deploying with the Web Viewer

4 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 4 Objectives  Become Familiar with BIRT Designer  Know how to create and design BIRT reports and projects  Access Data in BIRT Reports  Report Layout and Formatting Using Styles  Sort, Group Data  Use Report Parameters  Create and Format Charts  Write Expressions Using Scripting  Creating and Using Libraries and Templates  Deploy BIRT Reports

5 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 5 5 Easy Hard Presentation Focus BIRT Tasks – Audience  BIRT Report Developers  Advanced BIRT Developers  Deploy Experts  Reporting Integration  BIRT Extension  BIRT Core Development  Drag & Drop, Charting, Properties  BIRT Scripting  BIRT Viewer  Design Engine API  BIRT Extension Points  Eclipse Development

6 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 6 BIRT Target Users & Benefits  Embed pre-designed reports in application  Designs reports using Eclipse-based designer  Creates report libraries & templates  Powerful and easy to use report designer  Creates & uses report libraries & templates  Focused on $, developer productivity  End user satisfaction  Quick availability of reports  Reports that also look good  Content as HTML and PDF  Reports that support business activities  Ever changing business requirements  Minimizes Eclipse developer training  Increase developer productivity  Lower costs  Saves calories vs. JSP/Java  Minutes vs. days for HTML, vs. weeks for PDF  Minutes to modify as user requirements change  Iterative development gets the right reports quicker Managers End Users Report Developers Java Developers  Flexible, web page design metaphor  Ability to leverage complex components

7 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 7 Report Designer High Level BIRT Architecture Report Engine Presentation Services Report Design Engine XML Report Design Report Document HTML PDF Print Eclipse Report Designer Generation Services Data Transform. Services Charting Engine Data Chart Designer Eclipse DTP ODA Custom Designer

8 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Reporting Objectives: Become Familiar with BIRT Workbench To create a BIRT Reporting Project To create a BIRT Report Introduce the BIRT Workbench Create a simple Product Profitability & Inventory Report End User Customizing via Report Parameters

9 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 9 9 The Quick Tour  The BIRT Perspective  Data View, Palette, Outline View, Layout, Code, Preview  BIRT Data  Data Sources, Data Sets, Parameters  BIRT Layout  Grids, Tables, Controls, Data Binding  BIRT Code  Expression Builders vs. Code Pages  BIRT Preview  HTML View, BIRT Viewer, PDF Viewer

10 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 10 Birt Designer  Graphical report designer, similar to web development applications such as Dreamweaver or Nvu  Provides visual environment to quickly “draw” reports  Provides mechanisms to quickly create data connections  Provides Project Management

11 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 11 Workbench

12 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Navigator  Navigates through Eclipse projects and files under those projects  Allows user to run report inside of BIRT

13 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Outline  Provides hierarchy of current report  Allows for easy navigation of report elements to change properties in the property pane  When selecting libraries, use the outline to copy non-visual components such as data sources and sets

14 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Palette  Contains a number of visual elements used in BIRT report designs  Similar to Toolboxes in MS Visual Studio and other visual IDE

15 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Data Explorer  Contains.  Data Sources: Connections to database.  Data Sets: Same as a Recordset. Allows users to navigate through Query Results.  Report Parameters: Used as the interface for report parameters that will be passed to a Data Set.

16 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Report Designer  Area where report layout is designed, previews of the report are seen, scripts and events are coded, and XML source for report can be viewed.

17 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Areas of the BIRT Workspace (Cont.)  Properties Pane.  Properties for BIRT objects can be modified, such as Data Set Binding, Font information, formatting for Data Set returns such as Row Highlighting and Color Alternation.

18 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 18 Top Level Report Layout  Master Pages  Contains elements visible on every page, such as page headers  Grids  Used to position elements on page  Contains no Data Bindings  Tables  Grids with Data Binding  Has Header, Detail, and Footer bands  Lists  Single Column Tables

19 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 19 Demo – Static Report Background: Our Manager, Mr Ernie, wants a generic letterhead. Build a letter head for Classic Cars using containers to format the layout. Objectives: Familiarize you with the concept of containers for Report Elements

20 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Setting up a Project  BIRT uses the eclipse paradigm of using projects  File/new/project  From the project wizard, select report project from under BIRT  Set project name  Projects are shown in the eclipse navigator

21 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Setting up a Report  With eclipse project open  From file menu  File/new/report  From navigator  Right-mouse click on report project, new/report  Select project to associate report with and give file name

22 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 22 Containers

23 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 23 Data Access  Data Sources  Handled data connections  Data Sets  Defined Data to be used in Report  Parameters  Used for User Interaction to Filter Data  Cascading Parameters  Parameter Binding

24 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Setting up JDBC  Setup is done via the Data Explorer when setting up a new data source.  Click on the “manage drivers” button.  Point to JDBC ZIP/JAR file.  In order to set up connection, you must know the JDBC URL.  Can set a template of the JDBC URL format for future use of driver. This makes it easier for future connections.  Datasources can be added to libraries for report projects that use consistent datasources.

25 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Creating a Data Set  With data source(s) created, right-click on data set and chose new.  Type in SQL query.  Can create Joined Data Sets to combine 2 or more data sources.  Here I am using a questionmark, which will bind a report parameter to a query.  Datasets can be added to libraries.  http://birtworld.blogspot.com/2006/05/joi ned-data-sets-with-birt-21.html

26 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Report Parameters  Used to create dynamic result sets from queries  Binds user input to filter results sets  Parameters get assigned in sequential order, first parameter gets assigned to first bind variable in query  Report Parameters get stored as global variables in reports, accessible in scripts and expressions in addition to data.

27 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 27 Tables  Slots  Header  Detail  Footer  Data Binding  Makes table/list aware of values in Data Set  Grouping  Group on value in Data Set  Sorting  Sort on value in Data Set

28 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 28 Styles  Built In  CSS  Themes

29 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 29 Aggregates  Aggregate operations  Sum  Avg  Count  Done at the binding level

30 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 30 Viewing Reports  Preview  Web Viewer  Emitters

31 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Report Run  Can Run from Navigator or from File Menu  Reports that get run open in separate browser window.  Results can be saved.  Option to view as HTML, Word, Excel, PDF

32 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 32 Demo – Building Reports - Product Profitability Report Scenario: You work for the Classic Cars company. Your boss, Mr Ernie, wants a report that is a simple listing of all product sales in the database, with the total costs and total profits for each product arranged by State and City, sorted in order of decreasing amounts of total profits. Provide a report parameter to limit the listing to just 1 state. Make sure that the parameter only lists those states already in the database. Objective: To Familiarize ourselves with building reports with Data awareness and work with data.

33 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 33 Demo – Product Profitability Report 1.Bring up Eclipse 2.Open the BIRT Perspective 3.In the Navigator View create a BIRT Report Project 4.In the Project create a BIRT Report 5.Add a data source to the Classic Models Sample database 6.Add a data set to list products, total costs, total profits 7.Add report items 8.Format report 9.Group items 10.Sort items 11.Add report parameters 12.Add data set parameters 13.Preview

34 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Lesson 2 – Charting in Reports

35 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 35 Basic Concepts – Charting in Reports  Charts integrated with BIRT Report Designer  Charts can be used standalone as a library  Wide variety of chart types  Many formatting options  Charts are extensible to include more types

36 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 36 Pie Charts  2D, 2D with depth  Ratio, Explode slices, Min Slice

37 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 37 Bar Charts  Horizontal, Vertical  2D, 2D w/depth, 3D  Stacked, Side-by-side  Percent, Logarithmic

38 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 38 Bar Charts 38

39 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 39 Cones – Tubes – Pyramids 39

40 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 40 Line Charts  Horizontal, Vertical  2D, 3D  Various types of markers  Line styles, thicknesses  Drawn as Line, Curve

41 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 41 Stock Charts  CandleStick / Bar Stick  Horizontal, Vertical  2D  Formatting control

42 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 42 Scatter Charts  Horizontal, Vertical  2D  Various types of markers  Line styles, thicknesses  Drawn as Line, Curve

43 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 43 Area Charts  Horizontal, Vertical  2D, 2D w/depth, 3D  Stacked, Side-by-side  Percent, Logarithmic  Drawn as Line, Curve

44 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 44 Difference/Range Charts 44  2D. Curve or Straight lines.  New Negative/Positive Fill also works for other types.

45 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 45 Meter Charts  2D, formatting control  Regions, Needle styles, thicknesses

46 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 46 Gantt Charts 46  2D. Custom Bar width  Custom Start/End Markers  Data : Task ID / Start Date, End Date, Task Name

47 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 47 Bubble Charts  2D  Custom Bubble shape – Square, triangle, diamond, star, icon… 47

48 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 48 Data Binding in Charts  Bind through Data Set  Bind through Report Element

49 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 49 Interactivity in Charts  Can jump to anchor points  Drill Through to other Reports  Interactivity through Javascript

50 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 50 Demo – Charting in Your Report Scenario: Mr. Ernie wants a report that is a simple listing of all products in the database, with the number of units in stock. Arrange the products for each Product Line and sorted the products in each product line in decreasing order of total inventory. Your boss would also like to only list those products with a minimum quantity in stock. Provide a report parameter to limit the output to those products with a quantity in stock greater than that specified in the report parameter. Add a Pie chart to this report to list products and their inventory.

51 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 51 Demo – Charting in Your Report 1.Start with the Product Listing report. 2.Select Product Line grouping row 3.Insert row below titles 4.Merge cells 5.Insert chart 6.Select Pie chart, SVG output 7.Inherit data from container 8.Category – Product Name, group; Value – Quantity In Stock, aggregate by Sum() 9.Format chart

52 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 52 Demo – Charting in Your Report Final Output

53 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Lesson 3 – Scripting in a BIRT Report Objectives: To build simple expressions for highlighting To build JavaScript scripts

54 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 Scripting  For some logical calculations and report-centric tasks, a JavaScript based scripting engine has been embedded into BIRT.  Report events can be overridden to implement custom actions, such as creating calculated fields on row retrieval from a dataset.  Variables can be declared and used persistently throughout reports through scripting mechanism.  http://birtworld.blogspot.com/2006/03/java-and-session-objects- in-birt.html http://birtworld.blogspot.com/2006/03/java-and-session-objects- in-birt.html  Later presentation more focused on Scripting: “Advanced BIRT Report Customization” tell Virgil and Jason that I sent you ;)

55 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 55 Scripting Background  Do you know Javascript?  Do you know Java?

56 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 56 BIRT Utilizes the Mozilla Rhino Javascript engine. All the features of JavaScript 1.5 BIRT Script allows for use of Java classes and methods (regular expression, searches, etc) as well as custom Java objects Event Handlers can be external Java objects, not just Javascript BIRT Awesome!

57 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Simple, 1 line expressions Used in data elements to return single result Used in visual elements as a simple condition or to retrieve display values Triggered by Events in BIRT onOpen onRender Fetch Complex, multi line statements Contain advanced logic to manipulate BIRT elements Can reference and set external elements Can invoke external Java objects

58 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 58 Demo – Expressions Scenario: Ernie wants a Employee Sales Performance Report. Have a chart to show employee sales against a quota, and create a computed column for grouping. Objective: Demonstrate basic expression in Data Elements, complex expressions in the computed column and groupings.

59 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 59 Scripting/Event Handling (Simplified) Handlers are called for particular events Handlers are methods Code to do task is placed in the method Can be externalized in Java objects http://www.eclipse.org/birt/phoenix/deploy/reportScripting.p hp#javaevents

60 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 60 Demo – Using Java Scripted Data Source Scenario: A request has come through from the Java developers to create a method to list all the Java environment variables to assist in application development. Objective: Give a quick overview of the Scripting event model by creating a scripted data source.

61 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 61 Demo – Using Java Scripted Data Source  Create a scripted data source object  Create a scripted data set  3 data fields: Name, Value, Type  In Open Method  Assign the Packages.java.lang.System.getProperties() to a variable.  Get iterator from the entrySet().iterator() method.  In Fetch Method while (propIter.hasNext()) { entry = propIter.next(); row['propName'] = entry.getKey(); row['propValue'] = entry.getValue(); return true; } return false;  Add data grid

62 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Lesson 4 – Libraries and Templates Objectives: To use & build BIRT Report Libraries in building reports To use & build BIRT Report Templates

63 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 63 Basic Concepts - Libraries  Enables collaboration in report development, speeds up report design  Large #’s of report developers, or, large #’s of reports  Many designs use same elements, or layouts  Stores report items shared between multiple developers/reports  Use multiple libraries in a report design  Changes to report items in library reflected in all report designs  Open design in designer  Generate report  Group related styles into a theme  Can convert a report design into a report library  File extension -.rptlibrary  Define resource folder location in Window->Preferences->Report Design->Resource

64 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 64 Demo – Using a BIRT Library 1.Create BIRTLib.rptlibrary to Workspace 2.Refresh project 3.Open BIRTLib.rptlibrary 4.Publish library to resource folder 5.Copy visual items to report editor 6.Copy data sets to report Outline view 7.Preview 8.Change a report item in library 9.Preview

65 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 65 Basic Concepts – Templates  Serve as starting points for speedy report development  Template captures visual relationships of report items  Degree of completed template depends on requirements  Can use report libraries in template  Design of template is similar to report design  Define template location in Window->Preferences->Report Design->Template

66 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 66 Demo – Creating a Template 1.Create New Template in similar fashion to a report design 2.Specify display name, description, image 3.Design template just as a report design 4.Register Template with New Report wizard 5.Open existing report. 6.Save as Template.

67 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Lesson 5 – Deploying with the Web Viewer Objectives: To deploy BIRT Reports in Tomcat Discuss other Deployment Options

68 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 68 Traditional Report Deployment Strategies  Burst reports  Took lots of resources  Online Reports  None BI based solutions  Cumbersome and time consuming to develop  Error prone  No consistent interfaces

69 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 69 Online Report Deployment  Using BI Based Solutions  Rapid Deployment  Available to global audience  Ability to deploy to a number of commonly used formats

70 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 70 BIRT Deployment Capabilities  From the Designer  HTML  MS Office Formats  (Note: Excel not yet included)  PDF  Postscript  From the web viewer  HTML  Real-time navigation  CSV  PDF

71 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 71 More advanced Deployment Options  Beyond scope of this class  Report Engine embedding into Java applications  See later tutorial: “Integrating Reporting into your Application” and tell Scott I said Hi.  Chart Engine Navigation  See tomorrows talk: “BIRT Chart APIs”  Advanced Report Design Retrieval methods  Retrieve from archive  Retrieve from Database  Remote File System Retrieval  SSH  FTP  SMB/CIFS

72 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 72 The BIRT Web Viewer Example Application  Good starting point for deploying online applications  Does most of the important functions that online report viewers need  Table of Contents  Pagination and Navigation  Export for Print, PDF, Word, Excel  Export to CSV for resorting and manipulation of numbers  Parameters through internal and external parameter pages  Deploys to J2EE containers

73 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 73 BIRT Web Viewer Available From  BIRT Runtime Package  Contains all libraries already  BIRT Eclipse Designer  Contains all packages needed for web viewer  Needs to be copied among different packages  Compiled from Source  Download Source from CVS  Modify source as needed and compile to deploy  New in BIRT 2.2, New Project

74 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 74 Deploying Reports to the Web Viewer application  Copy files over to the Documents folder  Accessed using the “__report” URL parameter  Subsequent parameters can be called via the parameter dialog, URL parameter passing, or through external FORMS

75 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 75 Demo – Deploying to the Web Viewer application  Deploying Report  Copy report into working directory  Run the example report

76 Basic BIRT | Report Design | © 2008 by John Ward made available under the EPL v1.0 76 BIRT Project Summary  Top level Eclipse project  100% Java, Open Source, powerful, extensible reporting technology  Easy to use, with a web centric design metaphor  Supported by an active community  Open source and free, with a commercial friendly license  Getting started & learning more:  My blog: http://digiassn.blogspot.com  BIRT pages on Eclipse Web site http://www.eclipse.org/birt  BIRT pages on Actuate Web site http://www.actuate.com/birt  BIRT related blog http://birtworld.blogspot.comhttp://birtworld.blogspot.com  BIRT Newsgroup news://news.eclipse.org/eclipse.birt

77 © 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Q/A


Download ppt "© 2008 by John Ward made available under the EPL v1.0 | Date | Other Information, if necessary Basic BIRT Report Development John Ward, Innovent Solutions."

Similar presentations


Ads by Google