iReport 3.7 - Ahammad Shamsuddin - E-Book

iReport 3.7 E-Book

Shamsuddin Ahammad

0,0
20,73 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

In Detail

Although JasperReports is the world's most popular open source Java reporting library, it has always lacked one thing: It doesn't provide a tool to visually design reports. iReport is a visual report designer built on JasperReports that fills that lack. It is an intuitive and easy-to-use visual report builder/designer for JasperReports, written in 100% pure Java.

This beginner's tutorial book is a straightforward introduction to the iReport environment taking an example-oriented approach in developing your skills from scratch. It shows you how to use iReport for creating reports in PDF, RTF, and other formats, which can be delivered over the Web for immediate access.

This book will guide you through using iReport to develop various types of reports from a simple report through to dynamic enterprise-level reports based on realistic examples based on a sample Inventory Management System. It takes you through the main types of report available in iReport, and shows you exactly how to create them. It shows you how to use different report templates, how to use special kinds of data operations to generate more powerful reports, combine data to produce master-detail reports, add images, control the layout and formatting of your report and many more.

It will also show you how to use the NetBeans IDE to create Java projects with reporting facilities. You will learn how to vary report format and layout according to business requirements.

Approach

Step-by-step example-driven tutorials make this book very easy to follow. Practical, realistic business examples, many relevant screenshots, and simple discussion of prior concepts help readers to understand from the simplest to the most complex concepts.

Who this book is for

This book is for business intelligence reporting tool users and developers who have working experience in Java but are new to iReport. The book covers from developing a simple report to charting and producing summary reports in iReport, so it is suitable both for the initial learners and experts who produce extensive reports for business applications.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 140

Veröffentlichungsjahr: 2010

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

iReport 3.7
Credits
About the Author
About the Reviewer
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Introduction to iReport
iReport features
Simple to use GUI
Report designer and tools
Data sources
Report templates
Export and preview
iReport Classic vs iReport NB
Downloading and installing iReport
References
Summary
2. Building Your First Report
Creating a connection/data source
Building your first report
Viewing and exporting the report
Summary
3. Report Layout and Formatting
Setting up the report pages
Configuring the page format
Page size
Configuring properties
What are the different checkboxes?
When there is no data
Configuring bands, formatting reports and elements
Showing/hiding bands and inserting elements
Sizing elements
Positioning elements
Handling null values
Font settings
Creating text field pattern
Setting borders
Using tools for current date and inserting page numbers
Summary
4. Using Variables
Reviewing the database tables
Creating a basic report
Adding variables
Adding total variable
Adding a grand total
Summary
5. Using Parameters
What is a parameter?
Adding parameters in the SalesDetails report
Using more than one parameter
Summary
6. Grouping Data in Reports
Building a Group by report
Modifying group properties
Managing report groups
Variables for the group
Summary
7. Subreports
Creating a subreport
Creating the master report
Creating the subreport
Returning values from the subreport
Using an existing report as a subreport
Compiling a report
Summary
8. Crosstab Reports
Understanding a crosstab report
Creating a crosstab report
Formatting crosstab elements
Summary
9. Charting
Developing a pie chart report
Developing a 3D pie chart report
Developing a bar chart report
Summary
10. Working with Images
Displaying an image from the database
Scaling images
Displaying images from the hard drive
Setting a background image
Summary
11. Calling Reports from Java Applications
Downloading and installing NetBeans
Creating a project in NetBeans
Creating the iReport viewer class
Adding JasperReports API in the NetBeans project
Creating the viewer class
Accessing the database
Filling the report with data
Viewing the report
Calling the viewer class
Creating GUI with menus
Calling a report without a parameter
Calling a report with a parameter
Calling reports from a web application
Summary
12. iReport in NetBeans
Installing iReport plugins in NetBeans
Creating reports
Creating a NetBeans database JDBC connection
Creating a report data source
Creating a simple report
Creating a parameterized report
Summary
A. A Sample Database
Designing the database
List of entities
Data dictionary
Entity Relationship Diagram (ERD)
Installing MySQL and GUI tools
Configuring MySQL Server Instance
Creating a database
Backing up and restoring database
Backing up the database
Restoring the database
Index

iReport 3.7

Shamsuddin Ahammad

iReport 3.7

Copyright © 2010 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: March 2010

Production Reference: 1250210

Published by Packt Publishing Ltd.

32 Lincoln Road

Olton

Birmingham, B27 6PA, UK.

ISBN 978-1-847198-80-8

www.packtpub.com

Cover Image by Karl Swedberg (<[email protected]>)

Credits

Author

Shamsuddin Ahammad

Reviewer

Giulio Toffoli

Acquisition Editor

Douglas Paterson

Development Editor

Chaitanya Apte

Technical Editor

Siddhant Rai

Copy Editor

Leonard D'Silva

Indexer

Monica Ajmera Mehta

Editorial Team Leader

Mithun Sehgal

Project Team Leader

Lata Basantani

Project Coordinator

Srimoyee Ghoshal

Proofreader

Cathy Cumberlidge

Production Coordinator

Shantanu Zagade

Cover Work

Shantanu Zagade

About the Author

ShamsuddinAhammad is a Senior Lecturer at Daffodil Institute of IT (DIIT), Bangladesh. He is the Course Coordinator of IT programs at DIIT. He has been teaching Java Programming, Database Systems, Systems Analysis and Design since 2002. He has experience in supervising hundreds of academic projects. Shamsuddin has a Masters degree in Management Information Systems from Daffodil International University, Dhaka. He obtained a BSc degree in Computing & Information Systems of NCC Education Ltd, UK and London Metropolitan University joint program from Daffodil Institute of IT. He is an additional article reviewer of the CONQUEST conference, Germany. He has been maintaining several blogs on Java technologies for years.

Extraordinary moral support of my respected parents and my loving wife Jesmin Rashid is the greatest inspiration to write this book.

My brother and sisters, my relatives, friends, and my colleagues at Daffodil Institute of IT have inspired me a lot in writing this book—special thanks to all of them. I'm very thankful to my friend Shahed Hasan for his warm support.

It is my great fortune to have worked with a great team of publishing professionals at Packt Publishing. My sincerest gratitude to Douglas Paterson, Srimoyee Ghoshal, Chaitanya Apte, and Siddhant Rai for their great cooperation in writing the book.

About the Reviewer

Giulio Toffoli is a Senior Software Engineer at JasperSoft Corporation, where he serves as the iReport project leader. He has been developing Java applications since 1999 and founded the iReport project in 2001. During this time, Giulio has enjoyed designing complex software architectures and implementing custom software solutions with a focus on desktop and multitiered, web-based, client-server applications using Java (J2EE/JEE) and open source technologies. Giulio has a degree in computer science from the University of Bologna and currently resides in Italy. Giulio has written several tutorials and articles about iReport and JasperSoft technologies. He is the author of The Definitive Guide to iReport, Vol. 2, edited by Apress, and co-author of JasperServer Ultimate Guide.

Preface

iReport is an intuitive and easy-to-use visual report designer/builder for JasperReports, which is written in Java.

Users can visually edit complex reports with charts, images, and subreports, as iReport is integrated with the leading open source library—JasperReports. JasperReports is the world's most popular open source Java reporting library, but doesn't provide an adapted tool to visually design reports. iReport is a visual report designer built on JasperReports. A person without much confidence with XML might not be able take full advantage of the JasperReports library. iReport works perfectly for such people.

This book is a straightforward introduction to the iReport environment taking an example-oriented approach in developing your skills from scratch. It will guide you through developing a simple report to a dynamic enterprise level report using iReport.

This book is a beginner's tutorial, which shows you how to use iReport for creating reports in PDF, RTF, and so on, which can be sent over the web for immediate access.

It will guide you in developing various types of reports, using realistic examples based on a sample Inventory Management System. This book takes you through the main types of reports available in iReport, and shows you exactly how to create them. It shows you how to use different report templates, how to use special kinds of data operations to generate more powerful reports, combine data to produce master-detail reports, add images, control the layout and formatting of your report, and much more.

This book will also show you how to use NetBeans IDE for creating a Java project with reporting facilities. You will learn about report formatting and layout according to business requirements.

What this book covers

Chapter 1, Introduction to iReport, looks at what iReport is, what you can do with iReport, the history of iReport, and installing iReport.

Chapter 2, Building your First Report, covers creating a new data source or database JDBC connection, creating a report using the Report Wizard, using the design query to produce the SQL for the report, viewing the report using the built-in viewer, exporting the report in different formats like PDF, RTF, and so on.

Chapter 3, Report Layout and Formatting, covers configuring report properties, understanding bands, configuring and using report bands, maintaining the size, position and alignment of the report elements, modifying report fonts, using the library, using borders, and modifying element properties.

Chapter 4, Using Variables, discusses the use of variables, adding variables in a report, and writing variable expressions.

Chapter 5, Using Parameters, discusses the necessity of parameters, adding/ modifying parameters, and modifying the SQL query for using the parameters.

Chapter 6, Grouping Data in Reports, discusses report groups and grouping data together.

Chapter 7, Subreports, covers what subreports are, creating subreports, compiling subreports, linking the main report to the subreport, and passing data between the main report and the subreport.

Chapter 8, Crosstab Reports, discusses what crosstab elements are and how to use crosstab elements in reports.

Chapter 9, Charting, covers how to create reports with pie charts, 3D pie charts, and bar charts.

Chapter 10, Working with Images, covers how to display images in reports from the database, how to display static images from the hard drive, and how to set background images in a report.

Chapter 11, Calling Reports from Java Applications, discusses the JasperReports library for calling iReport from your Java application.

Chapter 12, iReport in NetBeans, discusses installing iReport plugins in NetBeans and creating reports from within the NetBeans IDE.

Appendix, A Sample Database, explains a sample database design and the development of an inventory management system.

What you need for this book

The following software must be installed for this book:

iReport 3.7.x

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

JDK 6

http://java.sun.com/javase/downloads/index.jsp

NetBeans

http://netbeans.org/downloads/index.html

MySQL 5

http://dev.mysql.com/downloads/mysql/5.5.html

MySQL GUI Tools

http://dev.mysql.com/downloads/gui-tools/

Who this book is for

This book is for people new to iReport, business intelligence reporting tool users, and developers who have working experience in Java. This book shows you how to develop a simple report, reports with charts, and summary reports in iReport. Thus this book is a perfect choice for both the initial learners and the experts, who produce extensive reports for business applications.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Tip

Downloading the example code for the book

Visit http://www.packtpub.com/files/code/8808_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Introduction to iReport

iReport is a reporting tool, developed in Java that helps users and developers design reports visually. Through a rich and simple-to-use user interface, iReport provides the most important functions to create complex reports easily, thus saving a lot of time.

iReport uses the JasperReports library inherently to create reports. JasperReports is, in a sense, the core of iReport. JasperReports is the most popular open source reporting library for Java technology, and iReport is a visual report designer for JasperReports. JasperReports has hundreds of features, but it itself doesn't provide any tool to visually design reports. A person without much confidence with XML might not be able take full advantage of the JasperReports library. iReport works for such people as well as for the expert report developers.

A report produced in iReport can be integrated in your open source or commercial application to generate reports, display them on screen, or export them in several formats including PDF, OpenOffice, DOCX, and many others. Alternatively, you can transfer the result through a web application or send the final document directly to a printer.

It is extremely easy to integrate JasperReports in any Java application using iReport. However, if you need an environment to use the reports without having to write a custom application, you may consider using JasperServer. JasperServer provides:

A web-based interface to manage, schedule, and run the reportsA repository to store all the report resources, such as images, fonts, data sources, and much moreA security service to decide who can execute which reportA web services API to execute the reports from external applications

iReport features

iReport can connect to any database and acquire data from different data sources. It can export the reports to PDF, XHTML, OpenOffice, MS Word, MS Excel, XML, Text, and many more. To understand what you can do with iReport, let's have an overview of the features.

Simple to use GUI

The User Interface (UI) of iReport is very user friendly. It provides some easy steps to generate reports using the Report Wizard.

The UI features of iReport include:

Drag-and-drop facilities for report elementsThe Palette window consisting of the ReportElements and ToolsEasy navigation of report objects through the ReportInspectorThe Properties window for setting properties of report elements, as shown next:Undo and Redo supportDockable and configurable interface window

Report designer and tools

You can design your report using a smart report designer. The following are some of the features of the designer: