O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pentaho Reporting 3.5 for Java Developers

Book Description

Create advanced reports, including cross tabs, sub-reports, and charts that connect to practically any data source using open source Pentaho Reporting.

  • Create great-looking enterprise reports in PDF, Excel, and HTML with Pentaho's Open Source Reporting Suite, and integrate report generation into your existing Java application with minimal hassle

  • Use data source options to develop advanced graphs, graphics, cross tabs, and sub-reports

  • Dive deeply into the Pentaho Reporting Engine's XML and Java APIs to create dynamic reports

  • Work with a multitude of examples throughout the book for quick learning on every topic

In Detail

Pentaho Reporting lets you create, generate, and distribute rich and sophisticated report content from different data sources. Knowing how to use it quickly and efficiently gives you the edge in producing reports from your database. If you have been looking for a book that has plenty of easy-to-understand instructions and also contains lots of examples and screenshots, this is where your search ends.

This book shows you how to replace or build your enterprise reporting solution from scratch with Pentaho's Reporting Suite. Through detailed examples, it dives deeply into all aspects of Pentaho's reporting functionalities, providing you with the knowledge you need to master report creation.

This book starts off with a number of examples to get you familiar with the tools and technology of the Pentaho Reporting Suite. Then, with additional examples, it goes into advanced subjects such as charting, sub-reporting, cross tabs, as well as API generation of reports. There are also details and examples on extending Pentaho's open source reporting engine. The reader will learn the ins and outs of Pentaho Report Designer, including a cheat sheet with all the available short-cut keys, to make report design efficient and painless.

Embedding reports into your Java application can be difficult. With Pentaho Reporting it's just a few lines of code. The book provides examples of how to embed reporting into your J2EE and client Java applications, as well as showing you how to build dynamic reports from scratch using Pentaho Reporting's simple Java Bean-based report generation API.

Setting up and integrating a reporting server in an enterprise environment can be arduous. In addition to learning how to build great embeddable reports, you'll also learn how to combine Pentaho Reporting with Pentaho's BI Server for a zero-code, easy-to-configure, enterprise reporting solution.

Table of Contents

  1. Pentaho Reporting 3.5 for Java Developers
  2. Credits
  3. Foreword
  4. About the Author
  5. About the Reviewers
  6. Preface
    1. What this book covers
    2. Who this book is for
    3. Conventions
    4. Reader feedback
    5. Customer support
      1. Downloading the example code for the book
      2. Errata
      3. Piracy
      4. Questions
  7. 1. An Introduction to Pentaho Reporting
    1. Typical uses of Pentaho Reporting
      1. Operational reporting
      2. Business intelligence reporting
      3. Financial reporting
      4. Production reporting
    2. Pentaho Reporting history
      1. Pentaho Reporting timeline
    3. Feature overview
      1. An advanced reporting algorithm
      2. A multitude of available data sources
      3. A wide variety of output formats
      4. Pixel accurate rich formatting
      5. Embedded charts
      6. Report parameterization
      7. Formulas and style expressions
      8. Sub-reports
      9. Cross Tab Reports
      10. Interactive reporting
      11. Rich authoring tools
      12. Reporting server
      13. Java API for building reports
      14. Extensibility
      15. A business friendly open source license
      16. Pentaho reporting roadmap
    4. Pentaho Reporting architecture
      1. LibBase
      2. LibDocBundle
      3. LibFonts
      4. LibFormat
      5. LibFormula
      6. LibLoader
      7. LibRepository
      8. LibSerializer
      9. LibXml
      10. Report Engine Core
      11. Report Engine Extensions
    5. Summary
  8. 2. Pentaho Reporting Client and Enterprise Examples
    1. Pentaho Reporting and example prerequisites
    2. Setting up Pentaho Reporting
    3. Building your first report
      1. Report Designer introduction
      2. Creating and configuring your first data source
      3. Report layout
        1. Creating the report title
        2. Creating column headings
        3. Populating the details band
        4. Creating a report summary
        5. Previewing and saving your report
    4. Embedding your report in a Swing application
      1. Setting up the Swing example application
      2. Incorporating Pentaho Reporting into the application
    5. Embedding your report in an enterprise web application
      1. Setting up the example Tomcat application
      2. Incorporating Pentaho Reporting into the web application
      3. Adding additional output formats
    6. Summary
  9. 3. Pentaho Reporting Examples in the Real World
    1. Setting up the example data source
    2. ElectroBarn inventory report
      1. Configuring the data source
      2. Creating a query
      3. Creating the Report Header and Page Footer
      4. Defining the Group Header
      5. Defining the Details band
      6. Defining the Group Footer and the Report Footer band
      7. Adding a pie chart
      8. Incorporating the inventory report into your J2EE environment
        1. Adding report selection as an input to the servlet
        2. Compiling and deploying the report servlet
    3. End of the day cashier balances
      1. Configuring an input parameter
      2. Configuring the data source query
      3. Creating the Report Header and Page Footer
      4. Defining the Details band
      5. Defining the Group bands
      6. Defining the main Group Header
      7. Incorporating the End of Day report into your J2EE environment
    4. ElectroBarn invoice example
      1. Configuring the data source query
      2. Defining the Group Header
      3. Defining the sub-report
      4. Defining the Details band
      5. Defining the Group Footer and Page Footer
      6. Incorporating the invoice report into your J2EE environment
    5. Summary
  10. 4. Design and Layout in Pentaho's Report Designer
    1. Report Designer user interface components
      1. Menu and toolbar
      2. Report element palette
      3. Report canvas tab panel
      4. Report Explorer
      5. Element Properties
      6. Messages
    2. Report bands
      1. Common properties
        1. Size and position properties
        2. Padding and border properties
        3. Page behavior properties
        4. Foreground and background color properties
        5. Excel properties
        6. Attribute properties
        7. Style inheritance
      2. Page Header and Page Footer
      3. Report Header and Report Footer
      4. Group Header and Group Footer
      5. Details Body
      6. Watermark
    3. Report elements
      1. Common properties
      2. Common text properties
        1. Font style properties
        2. Text style properties
        3. Text spacing properties
        4. Link properties
        5. Excel properties
      3. label
      4. text-field
      5. message
      6. number-field
      7. date-field
      8. resource-label
      9. resource-message
      10. resource-field
      11. chart
      12. content (static image)
      13. content-field (dynamic image)
      14. rectangle
      15. ellipse
      16. horizontal-line and vertical-line
      17. band
      18. sub-report
      19. survey-scale
      20. line-sparkline
      21. bar-sparkline
      22. pie-sparkline
      23. simple-barcodes
    4. Visual layout in Report Designer
      1. The Grid
      2. Guide lines
      3. Additional visual indicators
      4. Moving and aligning single elements
      5. Aligning groups of elements
      6. Miscellaneous layout capabilities
    5. Pentaho Report Designer shortcut keys
    6. Working with fonts
    7. Considerations for different output formats
      1. Cell output
      2. Paging
      3. Limits to rich graphics and charts
    8. Summary
  11. 5. Working with Data Sources
    1. Pentaho Reporting Engine Data API
      1. The DataFactory interface
      2. The ContextAwareDataFactory interface
      3. The TableModel interface
      4. DataFactory serialization
      5. Additional data source metadata
    2. Existing DataFactory implementations
      1. TableDataFactory
      2. NamedStaticDataFactory
        1. Query syntax
        2. NamedStaticDataFactory example
      3. SQLReportDataFactory
        1. StaticConnectionProvider
        2. DriverConnectionProvider
        3. JndiConnectionProvider
        4. SQLReportDataFactory example
      4. XPathDataFactory
        1. XPathDataFactory example
      5. HQLDataFactory
        1. StaticSessionProvider
        2. DefaultSessionProvider
        3. HQLDataFactory Example
      6. PmdDataFactory
        1. XMI file
        2. Domain Id
        3. IPmdConnectionProvider
        4. Registering MQL Queries
        5. PmdDataFactory example
      7. KettleDataFactory
        1. KettleDataFactory example
      8. BandedMDXDataFactory
        1. BandedMDXDataFactory example
      9. DenormalizedMDXDataFactory
      10. CompoundDataFactory
      11. Experimental data factories
    3. Accessing data throughout a report
    4. Summary
  12. 6. Including Charts and Graphics in Reports
    1. Supported charts
      1. Common chart rendering properties
      2. Common category series rendering properties
      3. Common XY series rendering properties
      4. Common dataset properties
      5. Common category series dataset properties
      6. Common XY series dataset properties
      7. Area chart
        1. Area chart example
      8. Bar chart
        1. Bar chart example
      9. Line chart
        1. Line chart example
      10. Pie chart
        1. Pie chart example
      11. Ring chart
        1. Ring chart example
      12. Multi pie chart
        1. Multi pie chart example
      13. Waterfall chart
        1. Waterfall chart example
      14. Bar line chart
        1. Bar line chart example
      15. Bubble chart
        1. Bubble chart example
      16. Scatter chart
        1. Scatter chart example
      17. XY Area, XY Bar and XY Line charts
        1. XY charts example
      18. Extended XY Line chart
        1. Extended XY Line chart example
      19. Radar chart
        1. Radar chart example
    2. Including static images in your report
    3. Including dynamic images in your report
    4. Summary
  13. 7. Parameterization, Functions, Formulas, and Internationalization in Reports
    1. Report parameterization
      1. Providing report parameters
      2. Available report parameter types
    2. Working with functions and expressions
      1. Common functions
      2. Report functions
      3. Summary functions
      4. Running functions
      5. Advanced functions
      6. Image functions
      7. Script functions
    3. Working with formulas
      1. Formula syntax
      2. Formula data types
      3. Formula operators
      4. Formula functions
        1. Date time functions
        2. Logical functions
        3. Mathematical functions
        4. Text functions
        5. Reporting Specific functions
        6. Miscellaneous functions
    4. Internationalization and localization of reports
      1. Localizing fields
      2. Localization example
    5. Summary
  14. 8. Adding Sub-Reports and Cross Tabs to Reports
    1. Adding sub-reports
      1. Multi-page sub-report example
      2. Chart sub-report example
      3. Side-by-side sub-report example
    2. Adding cross tabs
      1. Cross tab MDX example
      2. Cross tab SQL example
      3. Multiple row and column cross tab example
    3. Summary
  15. 9. Building Interactive Reports
    1. Interactive reports in Swing
      1. Registering event callbacks
        1. ReportHyperlinkListener
        2. ReportActionListener
        3. ReportMouseListener
      2. Interactive Swing example
    2. Interactive reports in HTML
      1. Interactive HTML report properties
      2. Manipulating the reporting HTML DOM
      3. Including an external CSS or JavaScript resource
      4. Interactive HTML example
        1. Adding interactive elements to the dashboard
    3. Summary
  16. 10. API-based Report Generation
    1. Understanding the serialized report format
      1. settings.xml
      2. datadefinition.xml and the datasources folder
        1. Parameters
        2. Data source reference
        3. Functions and expressions
      3. Data sources folder
      4. layout.xml
        1. Group and detail band hierarchy
        2. Report elements
        3. Example layout.xml file
      5. styles.xml
        1. Example styles.xml file
      6. Additional required files
      7. Building and running a .prpt bundle example file
    2. Building a report using Pentaho Reporting's Java API
      1. Adding a data source
      2. Defining parameters
      3. Including functions and expressions
      4. Defining the report's layout
        1. Common report bands
        2. Group band hierarchy
      5. Adding elements to the report
      6. Java API example
    3. Wizard Java API
    4. Summary
  17. 11. Extending Pentaho Reporting
    1. Implementing report functions and expressions
      1. Implementing expressions
        1. Defining an expression class
        2. Defining expression metadata
        3. An example expression
      2. Implementing functions
    2. Implementing a formula function
      1. Regex formula function example
    3. Implementing BeanShell expressions
      1. Example BSHExpression
    4. Implementing a report element
      1. Defining an ElementType class
      2. Defining element metadata
      3. Defining read and write handlers
      4. An example report element
    5. Summary
  18. 12. Additional Pentaho Reporting Topics
    1. Using Pentaho Reporting with Pentaho's Business Intelligence Server
      1. Downloading and Installing the BI Server
      2. Publishing a report to the BI Server
      3. Scheduling reports
      4. Configuring permissions
      5. Report emailing and bursting
      6. Managing database connections and users
      7. Creating ad hoc reports
    2. Mobile reporting
      1. Mobile report server
      2. Mobile report design
      3. Example: Pentaho's iPhone BI extension
    3. Data source metadata in Pentaho Reporting
      1. MetaTableModel API
      2. Mapping external metadata
      3. Using metadata attributes in a report
      4. Current MetaTableModel implementations
      5. Metadata example: DefaultMetaTableModel
    4. Working with Pentaho Reporting's output layer
      1. The OutputProcessorMetaData interface
      2. The OutputProcessor interface
      3. RenderNode Document Object Model
      4. Updating Report Designer
      5. Example: PojoObject output
    5. The Pentaho community—getting help and contributing
      1. Asking questions, helping others
      2. Online documentation
      3. Submitting bugs and viewing backlogs
      4. Contributing code
      5. Enterprise support
    6. Summary