Wednesday, 25 August 2010

Sql Report Writing Tutorial

The BIRT Report

Introduction

I recently attended the Maximo UK and Ireland User Group meeting at IBM’s fabulous Bedfont Lakes facility where we were treated to a demonstration of Actuate’s new BIRT reporting capability.



Although rather hampered in terms of performance by the virtual PC on which the demonstration was running the software and technology looked rather appealing. The interactive “flash” based reporting seemed to suggest that the long promised and tantalising possibility of “easy to create” dashboard style reports, over which the end user has an unparalleled degree of control may finally be a reality.



Just to set this in context, I have been a software developer for over 30 years, currently working in the field of interfacing Maximo with financial systems, it is rare that a new technology spikes my interest and imagination. So when I say that I spent a whole Saturday (much the chagrin of Mrs B) downloading, installing and attempting to understand what BIRT was all about, you will realise that this is indeed something worthy of note.



Working for a software vendor and yet still being granted the opportunity of attending the user group meeting I thought I would give something back by publishing the findings of my weekend’s toil so that other members of the group may benefit.



What is BIRT?



Initially I had no idea what BIRT was or what Actuate had to do with it, but somewhere along the line the magical words “open source” had been mentioned and I suspect that this may have had something to do with my new found enthusiasm for the product. So a bit of Googling later I discovered that BIRT (Business Intelligence Reporting Tools) was actually a freely available, open database reporting technology, that consisted of two major components, the report designer and the report server – which when combined allowed the user to create graphically rich reports that can be deployed from a central web server into a standard internet browser.



Roughly translated this means that pretty much anyone, with a reasonable working knowledge of the database against which they want to report can write reports that contain lists and graphs and that can allow the user to filter the data by any columns that the report author allows. Furthermore, these reports can be hosted on a central server in an organisations intranet or even on a publically available web server and viewed by anyone who had a copy of Internet Explorer handy on their PC. I suspect that other browsers are supported although I didn’t try that yet!



What do you need?



At first I discovered that in order to create a BIRT report one required a copy of something called Eclipse. This turned out to be a freely available, open source Integrated Development Environment (IDE) into which one installs the BIRT designer components. So I made my first goal to install a copy of Eclipse with these components installed.



Google soon pointed me in the right direction to obtain the relevant software and in no time I was able to follow a tutorial on how to build my first BIRT report.






The Eclipse Designer



At this stage I was beginning to be impressed – the report designer is clearly and logically laid out and basic listing reports are created in a similar manner to creating an HTML table in a WYSIWYG web design package. The downloadable components even include a database against which you can build your first report. This was a godsend because I had no idea how to connect the report designer to one of my existing SQL Server databases, but after creating my demo report this was my next challenge.



Connecting to SQL Server



Again turning to Google and the wonderfully informative BIRT forums I found a great Java component called JTDS, which according to the forums was faster and more reliable than the Microsoft JDBC connector. Once I had this in place I was very easily able to connect to my SQL server and access the tables. I still have a small problem with this whereby I am unable to browse the database tables from within the BIRT / Eclipse environment, but so long as I knew the table and field names that I was after this did not present a significant difficulty.



Getting Ambitious



Before long I had created a report which combined data from two tables, into a third, from which the ultimate report would run. I even ventured as far as creating four separate report variables,  that would allow the user to enter parameters such as a period and account range, against which the report would filter. Having gained some confidence by this stage I was able to apply a bar chart above my data table and even an image to the header of the report. Every step of the way I could preview my report in the report viewer and very soon came up with a result that I was reasonably happy with.



Having written a parameter driven report, containing advanced components and a complex data source my next challenge was to publish it to a browser.



Publishing to a Browser



For this I discovered that I needed a copy of the Tomcat web server, again freely available online. Having downloaded and installed Tomcat and put my report in the folder where the instructions told me to put it – it didn’t work! In order to solve the problem I had to copy my JTDS driver into the Tomcat server framework and restart the Tomcat service in order to pick up the change. Then I was able to point a web browser, from another machine, across the network at my Web server run my report from all the way across my living room!



What does Actuate Add



One of the exciting things about the demonstration that we saw on the user group day was the ability for the report user to physically tweak a flash control that looked a bit like a VU meter and have the report data modified to reflect the change in real time. This turns out to be the key difference between what you can download and use for free and what you get if you buy the BIRT add-ons from Actuate. There is also a different report designer available from Actuate and I shall be installing the trial version of these tools as soon as my wife will let me and hope to write about my experiences with those too.



Conclusion



In conclusion, the freely available BIRT reporting tools running on the Eclipse and Tomcat combination allow intermediate level users to create and deploy graphically rich, parameter driven reports. The report designer does need a good understanding of the source database and these reports are not capable of using the advanced, real time, flash based Actuate tools, but still offer an easy to use reporting environment with a result that is easy to deploy across the enterprise.



Contact the Author



If you need any specific advice or assistance and to receive updates on my further adventures with BIRT please feel free to contact me.





About the Author

Paul Bappoo

Maximo to financials integration
Automated Software Testing
Bespoke Software Development
System Implementation
Software design
Software Project Management
BIRT Enthusiast!

Paul@Bappoo.com



My first Sustainable Application with SIDE - v1 - Step 6 SQL for Alfresco and BIRT Report









sql report writing tutorial
sql report writing tutorial
sql report writing tutorial

No comments:

Post a Comment