Ad Hoc Graphical Reports

Final Report

Version <1.0>

Faculty Advisor

Dr. Kwok-Bun Yue

Mentor

Scott Hetherington

Abbasi Dhilawa

[

Team Members

Abdul Hafeez Khan

Augustine Patil Chirra

Nikhila Reddy Chilkamarri

Prathyusha Patinjaryil

Dr. Yue’s Comments for Version 1

·  There is no need to include header and footer in every page.

·  Page limit needs to be observed.

·  There are format problems.

·  Your team should not overuse bullets.

·  As an example how a technical report can be written, see: http://dcm.cl.uh.edu/c6838f06gp8/Docs/Final-Report.doc (However, because of its research nature, the report is longer than it is allowed this semester.)

ACKNOWLEDGEMENTS

We take the opportunity to thank our instructor Dr. Kwok-Bun Yue and the mentors, Mr. Scott Hetherington and Mr. Abbasi Dhilawa for the support and guidance they have provided us throughout the capstone without which the task assigned to us would not have been accomplished rightly. We would also like to thank Mr. David Webb for providing the Team with a dedicated computer in the capstone lab with all the required Softwares installed.

As a team, it was a wonderful experience working together. We appreciate the time and effort our mentors and the Instructor put for us during the meetings and assure them that the guidance provided by them was of utmost importance.

Finally we extend thanks to our family and friends who co-operated and provided immense confidence to us whenever we had a tough time.

ABSTRACT

Tietronix Ltd has a TieFlow utility called “Ad Hoc Report Generator” that allows users to define their own reports. The current utility is a J2EE-based web application, deployed in the JBoss Application Server. It allows users to select an area of interest (AOI) and specify the report name and description, the output columns, the filter columns with values, and the desired sorting, grouping, and calculations. It also offers the user to save the report templates which can be executed at any time. The result is a tabular output. The current capstone involves in enhancing the Ad Hoc Reporting Tool with graphical reporting ability. The objective is to tightly integrate JasperReports, which is an open source graphical reporting tool with Ad Hoc Reporting Tool. This involves writing a java code that generates the Report Definition XML (jrxml) which is understood by the run time JasperReports Engine to generate the desired chart. Six important business charts are well implemented in this Capstone. The generated output charts can be saved, and executed later just like the tabular reports.

TABLE OF CONTENTS

Acknowledgement i

Abstract ii

Table of Contents iii

List of Figures v

1. Introduction 1

2. Design and Implementation of the Solution 2

2.1 Block Diagram ……………………………………………………………….…………2

2.2 Use Case Diagram ……………………………………………………………………...4

2.3 Sequence Diagram ……………………………………………………………………..5

3. Main functions of the solution 6

4. Technologies Selected 6

5. Implementation Issues 7

6. Comparision with other alternative solutions 10

7. Evaluation of Solution 12

7.1 Solution to the problem.………………………….……………………………….……..12

7.2 Design of the solution…………..……...……………………………………….………12

7.3 Functionality of the solution………...…………………..…………………….………..13

7.4 Performance of the solution prototype……………………...…………………………..14

7.5 Lessons Learnt. ………………………………………...…………..…………………..14

7.6 Future Enhancements……………………………...…..………………………………..15

8. Project Management and Team Information………………….……………………………16

8.1 Tasks……………………………………………………………………………..……..16

8.2 Task Assignments………………………………………………………….…….……..17

8.3 Schedule………………………………………………………………………..……….17

9. Known Issues………………………………………………………………………………18

10. Conclusions…………………………………………………………………………………18

11. References…………………………………………………………………………………..19

12. Appendix A (Screen Shots of the User Interface)………………….……………………….20

13. Appendix B (How to Run Ad Hoc Graphical Reports……………………………………..34

List of Figures

Figure 1: Block Diagram 2

Figure 2: Use Case Diagram 4

Figure 3: Sequence Diagram 5

Figure 4: Bypass the XML and directly format Data 8

Figure 5: Showing tight integration with JasperReports 9

Figure 6: Project Time Line 15

Figure 7: Appendix A Screen Shots of User Interface……………………………………...... 20

http://dcm.cl.uh.edu/caps7g4 / ÓUHCL, 2007 / - ii -

Final Report

1.  Introduction

Tietronix currently has an Ad Hoc Reporting Tool that allows users to define their own reports. The tool is a J2EE-based web application currently deployed in the JBoss Application Server. The tool currently allows users to select an area of interest (AOI) and specify the report name and description, the output columns, the filter columns with values, and the desired sorting, grouping, and calculations. The report templates can also be saved and subsequently executed at any time. The current report output is a tabular display on the web page with options to export the results to a comma-separated file, a PDF file, an RTF file, raw XML, or a Java applet. While the Ad Hoc Reporting Tool has the basic functionality for textual reporting, it currently does not have the ability to generate charts, graphs, or any other graphical reporting format. The Ad Hoc Reporting Tool requires the ability to output the report results in various graphical formats in addition to its current textual output. The objective of this project is to tightly integrate an open-source graphical reporting tool with the TieFlow Ad Hoc Reporting Tool. The target graphical reporting tool is JasperReports. JasperReports is an open-source, Java reporting tool available as a Source Forge project.

2. Design and Implementation Issues

2.1 Block diagram

Figure 1: Block Diagram

The current Ad Hoc Reporting that was given to us has a graphical users interface (GUI) that generates tabular output. Our capstone includes adding another GUI very similar to the tabular reports GUI, which shares a common database with the tabular reports and a write a Java XML API that generates a jrxml which is understood by the Jasper Run time engine, to produce the graphical output.

The important blocks here are:

Current Capstone: This is the current TieReports Package of the Ad Hoc Report Generator which contains all the important classes like the Area of Interest Generator, Report Definition, which are required for the Graphical Reports Interface.

Java Code: The Java code generated the jrxml for a particular chart. Six different charts have different java classes that generate the specific jrxml according to the input parameters it takes for the output.

JasperReports: This is the runtime JasperReports Engine that accepts the jrxml generated and converts it to the final output chart for the report seeker. The JasperReports run time engine also comes to play when the graphical report is saved and later when executed, the jrxml is retrieved and complied again to produce the chart.

2.2 Use Case diagram

Figure 2: Use Case Diagram

The system here is the Ad Hoc Graphical Reports and the actor is the report seeker.

Use Case1: Report Seeker selects an Area of Interest

Use Case2: The generated Area of Interest is given back to the report seeker

Use Case3: Actor selects the Tabular or Graphical reports

Use Case4: Actor is presented with the options of the report generation

Use Case5: If Graphical charts are selected, system presents available parameters

Use Case6: System accepts input parameters and generates the chart

Use Case7: System presents the output chart to actor which can be saved, edited, executed.

2.3 Sequence Diagram

Figure 3: Sequence Diagram

The Sequence diagram focuses on identifying the behavior within the system. It elaborates the use case diagram cases in a more detailed manner, explaining each case. The process right from selecting the Area of Interest to the generation of the report is expressed above.

3.  Main functions of the Solution

The basic functionality of the system will be to present the user with the options to generate tabular chats or graphical charts. The graphical charts should be just a click away. The six important charts are presented to the user and when he selects a particular chart i.e. Bar Chart and specifies, its input parameters, the system should generate the equivalent jrxml, which is then complied by the Jasper Runtime engine and produce the output chart in the same browser. The user also is given the chance to save the generated output report so that it can be executed later on.

4.  Technologies Selected

·  JasperReports 1.3.0: JasperReports is the market leading open source business intelligence and reporting engine. The code is written entirely in Java, and the XML report templates are used to generate ready to print documents using data from customizable data sources, including JDBC. The output can be delivered to the screen, printer, or stored in PDF, HTML, XLS, RTF, CSV, and XML format

·  Java JDK 1.5

·  JBoss Application Server

·  Microsoft SQL Server 2005

5.  Implementation Issues:

Right from the first week of the Capstone we have been facing several difficulties in the implementation as well as understanding the Requirements. Few were cleared by the Instructor, few by the mentors and most of them were solved by the team effort. The initial project requirements were

·  To use XML Translator that uses the Java JDK version 1.4.2 for any required Java code.

·  XML Translator shall use the XML parser currently used by the Ad Hoc Report tool for any required XML processing.

·  The capstone shall implement an XML translator for translating the Ad Hoc report definition to BIRT report definition and Jasper Report Definition.

As seen above, the requirements mainly focused on using an XML translator and integrating the current Ad Hoc reporting tool with JasperReports and BIRT.

Dr. Yue suggested we bypass the XML translator part and instead write a java code that generates the xml report definition that is understood by JasperReports and BIRT. This explanation is clearly shown in the Figure 4.

Figure 4: Bypass the XML and directly format the data

The initial requirement also included implementing BIRT (Business Intelligence Reporting Tool) along with Jasper Reports. BIRT is an open-source Eclipse-based reporting system that can be integrated with a Java/J2EE application. We initially started working on both JasperReports and BIRT 2.2, but over the course of the project, we are not implementing BIRT, but only JasperReports due to the following reasons:

·  BIRT is a promising tool with excellent graphical reporting capabilities, but BIRT is a very young tool from Eclipse. It is still not mature as JasperReports.

·  It is very difficult to build BIRT outside the Eclipse environment as it is very tightly integrated with Eclipse

·  BIRT lacks proper documentation and contains bugs that need to be worked on.

·  WYSIWYG ability with BIRT is not too good.

·  BIRT is harder to integrate with other open reports than other engines.

·  Time constraint

·  Number of important Business Charts available with JasperReports and BIRT is almost the same. Hence we were asked to implement the six important business charts present in JasperReports and leave BIRT.

Some of the other difficulties encountered by us are listed below,

  1. As we were required to modify and add more features to the existing Ad Hoc Report Generator, understanding its working was initially the biggest challenge.
  2. We faced few problems while deploying the existing tool, for example, the Java SDK version to be used, SQL Server 2005 Network configuration and security settings (as SQL Server was used for the first time by the team members) and the memory out error in JBoss Server.
  3. Understanding the format of the jrxml and producing it tool a bulk of our time. We used iReports1.3.0, an IDE for generating graphical reports using JasperReports, to study the jrxml file format.
  4. Saving the report definition xml back to the database and retrieving it and executing it using the execute feature of the Tabular reports was a big challenge in the final stages of the capstone.

Now, we can proudly say that we have succeeded in overcoming all the challenges and are able to generate the Graphical charts as per the requirements.

6.  Comparison with other alternative solutions

The project can basically be divided into two major parts.

  1. Generating the Report definition XML(jrxml)
  2. Generating the Graphical charts

Figure 5: showing the tight integration of JasperReports

The Report Definition XML is the input for the JasperReports and it follows a specific format. It has its own tags understood by the JasperReports engine. The tags are called bands. This xml is then compiled by the JasperCompileManager to generate the required charts.

The solution can be well implemented using iReports, an open source java based IDE for generating charts using JasperReports. The sequence of steps in generating a simple graphical chart using this tool are listed below,

  1. Open iReport.
  2. Goto File->New Document
  3. Goto edit->Add Element->Chart
  4. Select any chart (say bar) from the chart info box.
  5. Select Data->Connections/Data Sources from the Main Menu. Specify the name and type of the connection.
  6. Select Data->Report Query. Write the query in SQL to retrieve the fields from the Database.

For example: select * from table1, table2;

Now an active connection is established to the Database and all the fields from the table can be viewed in the Library Pane in the right corner of the main window.

  1. Right click on the Chart and select chart properties. Check whether the show labels filed is selected. Goto Chart Data tab->Details, and add a Category Series. Select Category and Value Expression here. These should be any of the fields that you want on the X (category) and the Y (value) axis of the chart. The format for the fields should be $F{fieldname} For Example : $F{id}
  2. Save the file. A jrxml is now created.
  3. Goto Build->Execute (with Active Connection). The jrxml is compiled by the JasperReports compiler and a Graphical Bar Chart with the properties set by the user is displayed in an iReport JasperViewer.

As you can see from the above steps, creating a jrxml file by selecting all the parameters in iReport is a tedious thing to do. Also we felt that the procedure is not at all user friendly. Once a jrxml is created, the compile and execute part is done by the JasperReports engine built within the iReport.

We have successfully implemented the above 8 steps in just few clicks of the mouse in a very user friendly manner. The user selects the type of chart he desires and the category and value expression as parameters. By single click the jrxml is created by our application and compiled by the JasperReports integrated within it to produce a Graphical Report. The evaluation of our solution is described in the next section.