The complete getting started guide to birt reporting 1 (1)

5,572 views

Published on

Published in: Technology
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,572
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
0
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide

The complete getting started guide to birt reporting 1 (1)

  1. 1. The complete gettingstarted guide to BIRTReportingStarting out with BIRT report writing? Learn where to download the components, how toinstall them, how to get started writing reports against your own database and how todeploy your reports to remote web browsers.2009Paul BappooPaul@Bappoo.comhttp://www.BirtReporting.comOctober 2009
  2. 2. The Complete Getting Started Guide to BIRT ReportingPage | 2CONTENTSHow To Contact The Author..........................................................................................................................4Introduction.................................................................................................................................................5Downloading the Software ...........................................................................................................................6Eclipse......................................................................................................................................................6Java Virtual Machine.................................................................................................................................7SQL Database Driver .................................................................................................................................8BIRT Runtime............................................................................................................................................9Apache TomCat ......................................................................................................................................10Commons Logging ..................................................................................................................................11Summary of files required.......................................................................................................................12Report Writer Installation...........................................................................................................................13Java Runtime..........................................................................................................................................13Eclipse....................................................................................................................................................14Your first BIRT report..................................................................................................................................18Create the Project...................................................................................................................................18Create your report..................................................................................................................................22Using Your Own Database.......................................................................................................................25Installing the MS SQL Driver....................................................................................................................25Connect to your database.......................................................................................................................28Create a data set.....................................................................................................................................29Building the report..................................................................................................................................35Preview your report................................................................................................................................36
  3. 3. The Complete Getting Started Guide to BIRT ReportingPage | 3Publishing Your Report ...............................................................................................................................37Installing Tomcat ....................................................................................................................................37Installing the BIRT runtime......................................................................................................................40Install Data driver for tomcat ..................................................................................................................45Install your report under tomcat.............................................................................................................45View your report.....................................................................................................................................46Further Assistance......................................................................................................................................47Paul Bappoo - The Complete Getting Started Guide to BIRT Reporting© COPYRIGHT 2009 by Paul Bappoo, all rights reserved.This guide is furnished under license and may be used or copied only in accordance with the terms of such license. The content of this guideis furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by the author. Theauthor assumes no responsibility or liability for any errors or inaccuracies that may appear in this guide.Except as permitted by such license, no part of this publication may be reproduced, stored in a retrieval system or transmitted, in any form orby any means, electronic, mechanical, recording or otherwise, without the prior written permission of the author.All product and company names are trademarks or registered trademarks of their respective holders.
  4. 4. The Complete Getting Started Guide to BIRT ReportingPage | 4HOW TO CONTACT THE AUTHOREmail: Paul@Bappoo.comWeb Site: http://www.BirtReporting.comPaul Bappoo has been an international technical software consultant for over 30 years and has an interest inBIRT reporting, enterprise application integration, automated software testing, computer based training andenterprise system implementation.
  5. 5. The Complete Getting Started Guide to BIRT ReportingPage | 5INTRODUCTIONAfter seeing a demonstration of the Actuate implementation of BIRT at a recent IBM Maximo usergroup meeting I thought I would take a look at the free open source version of the software to seehow easy it was to actually install and use. If you’ve not read my overview yet then please feel freeto download it from:http://www.BIRTReporting.comOne of the things I found when I embarked on this project was that there were quite a fewcomponents that needed to be downloaded, installed and configured. Not only this but since thesecomponents are all open source, there are uncompiled versions available as well as differentcompiled versions. Because I am simply interested in begin able to create reports I decided to gofor pre-compiled versions but even then I had to spend a bit of time actually finding versions of allthe various components that would comfortably work together and allow me to access my owndatabases.Having been through the learning curve myself I decided to put this guide together and distribute itfreely online to anyone who wants to shortcut the getting started process and get straight intowriting their own BIRT reports.This copy of my installation guide is for you and should not be redistributed without my prior writtenconsent. However you are free to send out or post links to the download location which ishttp://www.BIRTReporting.comObviously software versions may have changed since I wrote this so lookout for new releases of thevarious components. I have listed the sites where I downloaded the various files but there are manymirrors out there so you may be better off just doing a search for the file names. Do be sure to scaneach file for viruses before you unpack it!I installed the whole kit onto a virtual machine to avoid breaking my main PC and have tried this onboth the Microsoft Virtual PC and VM Ware.
  6. 6. The Complete Getting Started Guide to BIRT ReportingPage | 6DOWNLOADING THE SOFTWAREECLIPSEThe BIRT report designer runs within the Eclipse Integrated Development Environment (IDE) sostart first by downloading a copy of Eclipse.I downloaded an “AllInOne” package which is pre-compiled and comes with all the dependenciesrequired to run the BIRT report designer in the Eclipse environment from here:http://mirrors.ibiblio.org/pub/mirrors/eclipse/technology/epp/downloads/release/galileo/RLook for the “Eclipse-reporting-galileo-win32.zip” link.
  7. 7. The Complete Getting Started Guide to BIRT ReportingPage | 7JAVA VIRTUAL MACHINEYou need Java installed to run Eclipse and I downloaded the Java runtime environment from SunMicrosystems at this address:http://www.java.com/en/download/inc/windows_upgrade_ie.jspLook for the “jre-6u16-windows-i586-s.exe” link
  8. 8. The Complete Getting Started Guide to BIRT ReportingPage | 8SQL DATABASE DRIVERTo be able to source data from MS SQL server you will need a database connectivity component.After looking around a bit the recommended way of doing this seems to be to use the JTDS datadriver, which I downloaded from here:http://sourceforge.net/projects/jtds/files/Look for the “jtds-1.2.3-dist.zip” link
  9. 9. The Complete Getting Started Guide to BIRT ReportingPage | 9BIRT RUNTIMETo deploy your reports you will need the BIRT runtime which I downloaded from:http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/birt/downloads/drops/R-R1-2_5_0-200906180630/Look for the “birt-runtime-2_5_0.zip” link
  10. 10. The Complete Getting Started Guide to BIRT ReportingPage | 10APACHE TOMCATYou will also need an application server on which to host your reports. TomCat is ideal and thedownload is available from:http://people.apache.org/~remm/tomcat-6/v6.0.20/bin/Look for the “apache-tomcat-6.0.20.exe” link
  11. 11. The Complete Getting Started Guide to BIRT ReportingPage | 11COMMONS LOGGINGFinally you will need the commons logging add-in for TomCat called Which I found here:http://www.apache.org/dist/commons/logging/binaries/Look for the “commons-logging-1.1.1-bin.zip” link
  12. 12. The Complete Getting Started Guide to BIRT ReportingPage | 12SUMMARY OF FILES REQUIREDFilenameEclipse-reporting-galileo-win32.zipjre-6u16-windows-i586-s.exejtds-1.2.3-dist.zipbirt-runtime-2_5_0.zipapache-tomcat-6.0.20.execommons-logging-1.1.1-bin.zip
  13. 13. The Complete Getting Started Guide to BIRT ReportingPage | 13REPORT WRITER INSTALLATIONIf you have any of these components already installed then you can skip the installation, but docheck to make sure you have the correct versions. It is possible to have multiple versions of most(of not all) of these files installed, so you may wish to install a second version if your existingversion is older but still in use. For example you can have multiple versions of the Java runtime on asingle PC and when you set up your applications you can explicitly tell them which version to use.Some applications, like Eclipse, allow this to be specified on the command line and others need thepath environment variable to contain the path to the required component.JAVA RUNTIMELaunch jre-6u16-windows-i586-s.exeIf you want to change the default installation location be sure to check the box in the lower left handcorner, although the default is suitable for most people. Then just follow the installation wizardaccepting the defaults.
  14. 14. The Complete Getting Started Guide to BIRT ReportingPage | 14ECLIPSENext unzip the eclipse-reporting-galileo-win32.zip. There is no further installation required – it justruns from where it is unzipped to, so put in into a suitable location. On Windows machines you canplace it into the Program Files area to be consistent with the rest of your programs.Then just launch eclipse.exe from the installation location.Eclipse is dependent on the Java platform so if you get a message similar to the following, it meansthat Eclipse can’t find the version of Java that you have just installed. This may happen if you havean earlier version of Java on your machine.To fix this you could simply add the path to the Java virtual machine to your system path, or youcan create a shortcut to eclipse.exe which contains an explicit pointer to the correct Java runtime touse. This is the command line I use:"C:Program Fileseclipseeclipse.exe" -vm "C:Program FilesJavajre6binclient"If you have spaces in your path e.g. between “Program” and “Files” as I do, then be sure to includethe entire path in quotes as I have done in this example.
  15. 15. The Complete Getting Started Guide to BIRT ReportingPage | 15Then when you launch Eclipse from your shortcut you should see the workspace selector.Select a suitable location for Eclipse to store your projects in and tick the “Use this as the default…”checkbox so you don’t have to make this selection again.If you have been successful you will see the Welcome screen.Hover your mouse over the various icons to see what they do, the one on the far right is the reportdesigner workbench. Clicking on this opens the main designer window.
  16. 16. The Complete Getting Started Guide to BIRT ReportingPage | 16The Eclipse IDEYou are currently not seeing BIRT within Eclipse. BIRT is what is known as a Perspective and toopen it go the Window menu and select: OPEN PERSPECTIVE REPORT DESIGN
  17. 17. The Complete Getting Started Guide to BIRT ReportingPage | 17If Report Design is not available on the menu, select: OTHER REPORT DESIGNfrom the list that appears.
  18. 18. The Complete Getting Started Guide to BIRT ReportingPage | 18YOUR FIRST BIRT REPORTThe BIRT perspective is displayed, notice how the panes are re-arranged to the BIRT view of the world.CREATE THE PROJECTYou are now ready to create your first BIRT report. Select: FILE NEW PROJECT
  19. 19. The Complete Getting Started Guide to BIRT ReportingPage | 19and in the window that opens select BUSINESS INTELLIGENCE AND REPORTING TOOLS REPORT PROJECTand click Next.
  20. 20. The Complete Getting Started Guide to BIRT ReportingPage | 20Enter a name for your project, like My First BIRT report and notice that the default path is chosenfor you as the one you selected when launching the application earlier.Click Finish.
  21. 21. The Complete Getting Started Guide to BIRT ReportingPage | 21Your project is created in the lower left hand pane.
  22. 22. The Complete Getting Started Guide to BIRT ReportingPage | 22CREATE YOUR REPORTTo create a report within your project select: FILE NEW REPORTand in the window that is displayed select “My First BIRT Report” or whatever you called the projectand enter a name for your report in the lower text field, like MyReport.rptdesignClick Next
  23. 23. The Complete Getting Started Guide to BIRT ReportingPage | 23BIRT Provides a number of report style templates to choose from, it’s probably a good idea to startwith a simple listing report for now.SELECT SIMPLE LISTING AND CLICK FINISH.
  24. 24. The Complete Getting Started Guide to BIRT ReportingPage | 24Notice how the Palette, data sources and resources are populated with the various tools you willneed to create your report. Also the main central window is populated with the report canvas whichalready contains a table. This is because you selected the Simple Listing template, if you hadselected a blank report then the table would not be created for you.The property editor is displayed in the lower half of the central window and on the right is the CheatSheets area, where you will find a full BIRT tutorial. Make a mental not of how to get back to this formore advanced information at a later stage. For now carry on through this simple guide to creatingyour first report against your own database.
  25. 25. The Complete Getting Started Guide to BIRT ReportingPage | 25USING YOUR OWN DATABASEThe demonstration database is a good place to get started but if you want to start reporting on yourown data then you will need to install a suitable data access component.You have already downloaded the JTDS database driver for MS SQL Server. You can of coursedownload other drivers for other databases, but for this guide we will focus on using MS SQL and aMaximo 6.2 database.INSTALLING THE MS SQL DRIVERStart by unzipping the JTDS-1.2.3-dist.zip into a folder within the Eclipse installation directory. Next,from the BIRT report designer RIGHT CLICK ON DATA SOURCES SELECT NEW DATA SOURCE SELECT JDBC DATA SOURCEenter a suitable name for your new data source and click Next
  26. 26. The Complete Getting Started Guide to BIRT ReportingPage | 26NOW CLICK MANAGE DRIVERSThen click ADD and navigate to where you unzipped the JTDS package earlier, then select theJTDS-1.2.3.jar file.
  27. 27. The Complete Getting Started Guide to BIRT ReportingPage | 27The driver file will be displayed in the JAR Files grid. Click on the DRIVERS tab and ensure that thedriver is visible in the list, then click OK.
  28. 28. The Complete Getting Started Guide to BIRT ReportingPage | 28CONNECT TO YOUR DATABASEComplete the form as in the screenshot to point to your database.The default port for SQL Server is 1433 and the Driver URL breaks down as follows:jdbc:jtds:sqlserver://server[:port][/database];After testing the connection and receiving the connection successful message click Finish.
  29. 29. The Complete Getting Started Guide to BIRT ReportingPage | 29You should now have a new data source available in the Data Explorer pane.CREATE A DATA SETThe next thing to do is create a data set, this is essentially the table against which you want toreport and it can be pre-filtered to show just certain records, plus you can add parameters into itwhich will be available to the viewer when running the report.These more advanced features are out of the scope of this document but I am intending to createspecific tutorials on this soon. You can create multiple data sets, even from multiple databases andthen combine these to feed into a single report.
  30. 30. The Complete Getting Started Guide to BIRT ReportingPage | 30For now create a simple data set, RIGHT CLICK ON DATA SETS SELECT NEW DATA SETand the following screen will be displayed.Select your data source from the list and enter a name for the data set – in my case I intend to listthe addresses from my Maximo database, so I have called the data set “Addresses”CLICK NEXT
  31. 31. The Complete Getting Started Guide to BIRT ReportingPage | 31Notice that the database users are displayed and under each user is a list of the tables that theyhave visibility over. Expand a table and the fields are listed.
  32. 32. The Complete Getting Started Guide to BIRT ReportingPage | 32So in my case I expand the Address table to view the fields.Then you can start to drag fields into the familiar SQL select query on the right. When happy withyour query click Finish.
  33. 33. The Complete Getting Started Guide to BIRT ReportingPage | 33
  34. 34. The Complete Getting Started Guide to BIRT ReportingPage | 34BIRT displays a screen where you can, amongst other things, see the results of your query. I will becovering the other options available here in more detail in a future report.For now, just click OK and you will see that your data set is listed in the data explorer window.
  35. 35. The Complete Getting Started Guide to BIRT ReportingPage | 35BUILDING THE REPORTIt is a simple matter of dragging fields from your data set into the table in the main body of yourreport to start to build up your report output.For now I have created a very simple example where I have inserted address lines in a column. Todo this I had to create multiple detail lines, by right clicking on the left hand border of the table andselecting Insert/Row.
  36. 36. The Complete Getting Started Guide to BIRT ReportingPage | 36PREVIEW YOUR REPORTFinally, it is time to preview the report which can be achieved by clicking on the fourth button fromthe left, in the toolbar.OK it’s not very pretty and I will be looking at the format and styling options that BIRT provides in afuture report, however for now this is enough to be going on with because now I want to focus onwhat you have to do to actually publish your report to a web browser.
  37. 37. The Complete Getting Started Guide to BIRT ReportingPage | 37PUBLISHING YOUR REPORTIn the Eclipse IDE, save your report to the default location (this is the location we selected duringthe BIRT installation) in my case C:BIRT and remember this because you will need it later. I calledmy report AddressReport.rptdesignTo deploy your reports you will need a web server, we will be using TomCat, which you should havealready downloaded by now, along with the required commons logging component and the BIRTruntime.INSTALLING TOMCATOn a Windows platform, simply run the Apache-Tomcat-6.0.20.exe installer and follow the wizard,selecting all the defaults.
  38. 38. The Complete Getting Started Guide to BIRT ReportingPage | 38If you already have a version of Tomcat or another application that uses port 8080, then you maywish to change the port number during the installation.Also during the installation Tomcat will ask for the path to the Java virtual machine. This is thelocation where we installed Java to earlier and in my case it isC:Program FilesJavajre6bin
  39. 39. The Complete Getting Started Guide to BIRT ReportingPage | 39At the end of the installation you are prompted to start Tomcat.Once this is done, to see if your Tomcat server is working simply open a web browser and point itat:http://localhost:8888Substituting 8888 in my example with the port that you selected during installation.
  40. 40. The Complete Getting Started Guide to BIRT ReportingPage | 40INSTALLING THE BIRT RUNTIMENext unpack the BIRT-Runtime-2_5_0.zip into a temporary folder. Open the folder and locate theWebViewerExample folder. Copy this entire folder to the WebApps folder of the Tomcat installation.E.g. C:Program FilesApache Software FoundationTomcat 6.0webappsWebViewerExampleand then rename the WebViewerExample folder to BIRT-ViewerNext unpack the commons-logging-1.1.1-bin.zip and copy the contents of the Commons-logging-1.1.1folder (note not the actual folder itself, just the contents) to:C:Program FilesApache Software FoundationTomcat 6.0webappsBirt-ViewerWEB-INFlib
  41. 41. The Complete Getting Started Guide to BIRT ReportingPage | 41Now stop and restart the Tomcat server service. This step is important as without restarting Tomcatit will not pickup the changes you have just made!Now check that BIRT has been successfully installed into Tomcat. Point your browser at:http://localhost:8888/manager/html
  42. 42. The Complete Getting Started Guide to BIRT ReportingPage | 42Remembering to substitute the 8888 with the port that you selected during Tomcat installation. Ifeverything is working correctly you should be challenged for the username and password that youselected during the Tomcat installation and once through security you should see the followingscreen:Click on the /Birt-Viewer link and you should see the following screen, confirming that BIRT issuccessfully installed.
  43. 43. The Complete Getting Started Guide to BIRT ReportingPage | 43Now click on the View Example link and the following screen should be displayed, showing anexample BIRT report in the web browser.If you made it this far, give yourself a pat on the back and pop open a can of your favouritecaffeinated fizzy drink!
  44. 44. The Complete Getting Started Guide to BIRT ReportingPage | 44At this point, take a copy of the URL displayed in the browsers address bar, you will need it in amoment, the address in my case is:http://localhost:8888/Birt-Viewer/frameset?__report=test.rptdesign&sample=my+parameterNow you need to move on to testing your own report that you created earlier. To do this you willneed to make the JDBC driver available to Tomcat.
  45. 45. The Complete Getting Started Guide to BIRT ReportingPage | 45INSTALL DATA DRIVER FOR TOMCATGo to your downloads and open up the JTDS data driver and look for the jtds-1.2.3.jar file. This isthe same file we copied earlier to the Eclipse folder. Copy it toC:Program FilesApache Software FoundationTomcat 6.0webappsBirt-ViewerWEB-INFplatformpluginsorg.eclipse.birt.report.data.oda.jdbc_2.5.0.v20090605driversIf the org.eclipse.birt.report.data.oda.jdbc_2.5.0.v20090605drivers folder does not exist, simply createit.INSTALL YOUR REPORT UNDER TOMCATNow go and get the report you created earlier, AddressReport.rptdesign from the place you saved it toe.g. C:BIRT AddressReport.rptdesign and copy it to the Tomcat web server, into theC:Program FilesApache Software FoundationTomcat 6.0webappsBirt-Viewer folder.
  46. 46. The Complete Getting Started Guide to BIRT ReportingPage | 46VIEW YOUR REPORTNow point a browser at the address you used earlier to test your BIRT installation but replace thereport name with the name of your report and strip off any additional parameters at the end of theaddress, so you end up with this address:http://localhost:8888/Birt-Viewer/frameset?__report=addressreport.rptdesignIf your report doesn’t work first time then try restarting the Tomcat server.If you still have problems deploying your report then have a look at the Eclipse project web sitehttp://www.eclipse.org/birt/phoenix/deploy/
  47. 47. The Complete Getting Started Guide to BIRT ReportingPage | 47FURTHER ASSISTANCECongratulations, by now you should have: Installed the BIRT report designer within the Eclipse IDE Followed the BIRT tutorials Connected BIRT with your own database Written a report against your own database Installed your web server Published your reportsFor more tutorials on BIRT go to the Eclipse help menu and select the BIRT Report Developer Guide.This is packed with excellent tutorials that you can follow to become familiar with the moreadvanced features of BIRT.If you would like to find out more about BIRT reporting then please visithttp://www.BIRTReporting.comPlease feel free to share this address with your colleagues and inspire them to use BIRT to creategreat looking reports.It’s always great to get feedback so please feel free to send me an email and let me know how youget on with BIRT, provide feedback on this guide, share your tips and tricks, or request help forspecific problems. I can’t guarantee to personally solve everyone’s problems but there are somegreat BIRT related forums out there and you can find a growing list of links and resources on mysite.Paul BappooPaul@Bappoo.comhttp://www.BIRTReporting.com

×