Recent posts

You are browsing Deploying Reports

Demo of using BIRT with ClearQuest Tomorrow

Tomorrow, November 19th, Actuate and IBM are co-presenting an online webinar on working with BIRT reports with IBM ClearQuest and I am doing the demo portion.  I plan to show BIRT reports inside the ClearQuest client, the ability to schedule and distribute those reports in the Actuate iServer Express, and interact with the reports using the Interactive Viewer.  There is still time to register if you want to attend.


Using the CSV emitter with BIRT 2.3.0

I’ve seen several questions lately on how to use the BIRT CSV Emitter example that is explained in the Integrating and Extending BIRT book. While the book goes into great detail explaining what each file does and even how to build the entire example yourself, my blog post will just give the basic steps necessary to use the example. The steps below assume you have an Eclipse IDE and have also downloaded the BIRT Runtime engine.

First we need to download the example CSV emitter project and the associated classes used to run the example.  You can find the files at this link. You will need both org.eclipse.birt.report.engine.emitter.csv.zip and ExecuteCSVReport.zip from the Report rendering section. 

Next, we need to import the files into Eclipse. 

Import BIRT Extension Project

  1. From the Eclipse IDE, select Import from the File menu and then select Existing Projects into Workspace under General and press Next.
  2. Select org.eclipse.birt.report.engine.emitter.csv.zip as the archive file and then make sure the project displayed is checked before pressing Finish.
  3. Repeat these steps to import the project from ExecuteCSVReport.zip. Don’t worry about any reference errors in the project at this time… we’ll correct those later.

Now that our projects are imported, we need to export the CSV emitter plug-in. 

Export BIRT plugin

  1. Right-click on the org.eclipse.birt.report.engine.emitter.csv project and select Export.
  2. Choose Deployable plug-ins and fragments from the Plug-In Development choices and press Next.
  3. Make sure your plug-in is selected and then choose your ReportEngine directory that is part of your BIRT Runtime Engine download.

Now that our new plug-in is exported, we need to test it.  The ExecuteCSVReport project contains an example report and code we can use for this test but first we need to fix the project references to point to our own BIRT Runtime Engine files.

  1. Right-click the ExecuteCSVReport project and select Properties.
  2. Select Java Build Path and then Libraries
  3. Highlight all the JAR files that indicate they are missing and press the Remove button.
  4. Press the Add External JARs button and select all the files from your ReportEngine/lib directory.
  5. Press the Add External JARs button again and this time select the new plug in you just created.  If you accepted the defaults from the export step above, then this should be in the ReportEngine/plugins directory in a file called org.eclipse.birt.report.engine.emitter.csv_1.0.0.jar.

Now that our project references are corrected, we need to correct one more reference in our ExecuteReport.java file that points to the BIRT Runtime Engine.

  1. Double-click ExecuteReport.java to open this file in the editor.
  2. Change the setEngineHome line to point to your ReportEngine directory like the example shows below.

config.setEngineHome( “C:/work/eclipse/BIRT_230/birt-runtime-2_3_0/ReportEngine” )

Once the ExecuteReport.java file is saved we can run the example.

  1. Right click on ExecuteReport.java and select Run As | Java Application. You will see a message that says “We are done!!!” in the Console if everything worked correctly.
  2. Press F5 on your ExecuteCSVReport project to refresh the files and you should now see a new file called csvReport.csv in the reports folder.

BIRT CSV Output


Test Drive Web Reporting Capabilities on BIRT Exchange

We’ve added a new live report environment to BIRT Exchange so you can play around with a number of products that make BIRT reports more interactive.

You can try out the BIRT Designer for End Users, that allows you to create BIRT reports over the web, or the Interactive Viewer that allows you to change the formatting of a BIRT report as you view it.

We’ll also be using this environment to host reports that illustrate design concepts that we refer to in DevShare entries or Forum posts.

Check it out here.


Sneak Peek at the new JavaScript API for BIRT Reporting

This new JavaScript API provides an embeddable BIRT Report Interactive Viewer, Report Parameter Control and DataService object that can be used in any web page (JSP, ASP, PHP, HTML, etc.), and also provides the APIs that allow custom JS code to interact with report content & report parameters.

You can get a sneak peek of the new JavaScript API this Friday, Sept 5th, at 9am PST in an online webinar through BIRT Exchange at the link below.  You can also download Milestone versions of this JavaScript API as part of the Actuate iServer Express available at the Actuate 10 Beta link below.

Webinar: Getting started with Actuate Web 2.0 JavaScript API (Friday, Sept 5th, at 9am PST)

Actuate 10 Beta page


Second Edition BIRT Books Now Available

BIRT Book Field Guide      BIRT Book Integrating

Two popular books, BIRT: A Field Guide to Reporting and Integrating and Extending BIRT, have been updated.  These books are now on their second edition and each include many more pages and examples.

The first book, BIRT: A Field Guide to Reporting, includes 109 more pages than the previous edition and covers several of the latest product features, including cross tabs and OLAP cubes, new chart types, web services as a data source, new report output formats, using CSS files, and localization of reports.  We found the second edition of this book at Amazon and informIT.

The second book, Integrating and Extending BIRT, includes 136 more pages and includes several new architectural diagrams and covers report and chart scripting, BIRT tag libraries, using the BIRT Web Viewer, JNDI support, an ODA plugin example, and lots more.  We also found the second edition of this book at Amazon and informIT.


New BIRT Book Reviewed

I was asked to review a new BIRT book by John Ward titled, Practical Data Analysis and Reporting with BIRT. This was a book that I had already downloaded and intended to read as mentioned in a previous post. As I started reading the book, I realized that this was a great introductory BIRT book. For that reason, I decided to have a new employee, who needed to get up to speed with BIRT quickly, use this book as his first training exercise. 

His overall impression was good and he thought this book was a nice starting point for a new BIRT user. When asked to rate this book from 1-10 on how well the book did for training a new user, he assigned this book an 8 out of 10. Below are a few relevant notes by chapter that were made while going through the book.
Chapter 1 - Introduction
Good introduction to Business Intelligence, where BIRT came from, and what it is.

Chapter 2 - Installing BIRT
This chapter contains easy to follow instructions for installing BIRT using several different methods.

Chapter 3 - The BIRT Environment and Your First Report
The author does a good job of showing readers what BIRT can do/give them in a report. The description of the Report Designer window is a bit confusing as you cannot see anything the author describes until after you have created a report. It might be better to create the report first and then go back and read the designer description.

Chapter 4 - Visual Report Components
Nice use of examples to show basic visual design components for reports. The chapter is also a very helpful introduction to some of the basic tools of BIRT.

Chapter 5 - Working with Data
This was a great chapter on BIRT Data Sources however some of the XML or report design examples talked about in this chapter assume you have these files. As a result, I had to type up the sample XML and flat files examples in order to complete the steps.

Chapter 6 - Report Parameters
Some confusion with the screenshot in step 7 of Cascading Parameters. This picture/figure looks like it belongs with step 12, where it also appears. Other than that little confusion, the author offers pretty straightforward examples for new users of BIRT related to parameters.

Chapter 7 - Report Projects and Libraries
Couldn’t do shared report example under Other Project Options as I don’t have a username and password authentication to a CVS server, so had to skip that part. Otherwise, good information on BIRT report projects and libraries.

Chapter 8 - Styles, Themes, and Templates
Good informative examples of how to create custom styles for your reports to make them unique to your company and fairly straightforward examples of templates, styles, and themes.

Chapter 9 - Charts, Hyperlinks, and Drill-Downs
Nice, simple charting, hyperlink, and drill-through examples. In this chapter, the author seemed to assume that the reader has totally grasped everything that was previously mentioned as some of the step details weren’t explained as well..  I found myself going back to previous chapters to remind myself how to do some things.

Chapter 10 - Scripting and Event Handling
I had some trouble with scripting in this chapter and couldn’t get the sorting script to work. The rest of the Javascript examples worked fine. I also had a bit of a problem with the Java objects event handler example. It could have been related to a typo or something similar since I had to type the Java code from reading the book.

Chapter 11 - Deployment
Good short examples/explanations of deployment options with BIRT and their versatility. This chapter shows how to deploy with the BIRT Viewer, running from the command line, and using the Report Engine API. I really wish I could have downloaded some of these examples instead of typing them.

Chapter 12 - Practical Example
Nice in-depth example of how BIRT can be used in real world applications. I didn’t actually do this example since I didn’t have Bugzilla or MySQL installed, but I understood the example from what I could read.


Using Properties Files to Localize BIRT Reports

I’ve received a few questions asking how to localize BIRT reports.  BIRT reports can be localized so that your users in offices around the world can see a report in their desired language and formating.  BIRT can automatically take care of the number, date, and currency formatting but there are other parts of the report to consider that would normally consist of static text.  These ncluding labels or text elements within a report, table and column headers, chart titles, etc.  For these elements, we need to replace the static text with external text from a properties file.

To get started, I created a couple of .properties file.  You will need one property file for each locale you plan to support.  For our example, I created one called MyResources_us_EN.properties and MyResources_fr.properties.  These are just text files and contain name value pairs like below.

welcome=Hello
goodbye=Later

…and…

welcome=Bonjour
goodbye=Au revoir

Once you have the properties files created, add them to your report project.  You can now select one of the properties files in the Resource File property of the report design (screenshot below).

 Set Resource File

Now that the properties file has been set, you can assign ‘keys’ to various controls within the report.  To add a key to a label, select the label and then Localization on the Property Editor tab.

Assign resource key

Press the […] button and you can pick the key to use from a list

Pick resource key

Perform these same steps for any other labels within the report.  You can use external text within the chart as well, anywhere you see the following icon.

External Text

Pressing this button will invoke a list like below where you can pick the resource key to use.

Select external text

If you need to externalize text that comes from a database, then you will need to use the mapping feature.  For example, if I want to localize the text from a group header and I want to replace the office number (1 through 7) with the words “First Office” for English and “Premier Bureau” for French, then I start by selecting the Office Number data field.  On the Map tab in the Property Editor, press the Add button to create a map rule.

BIRT Create Map Rule

In this example, when the Office Code field equals Office # 1, then replace the text with the value from our properties file that matches ‘1′.  Create a unique mapping for each value you want to externalize.

Once you have created all your mappings and have assigned the keys to each label or chart, then you are ready to test that it all works.  In order for the resource files to get selected correctly at runtime, we have to remove the locale specific information from the name of our resources file.  You do this by selecting the whitespace on the report again, and then on the Resources tab.  Remove ‘_us_EN’ from the name of the resource file so that it now reads ‘MyResources’ without any locale information at the end.

To test for different languages while in the BIRT Designer, select Window | Preferences | Report Design | Preview.  I’ll select French since that was the only other locale that I have a properties file for.

BIRT Preview Language Selection

Now when I run the report, my labels are replaced, the chart title is replaced, and the group header fields have been replaced.

BIRT Report Preview

If you are trying to set the name of the properties file or assign the resource keys with scripting, then you can do something like below in the beforeFactory event:

   var rr = reportContext.getReportRunnable();
   rr.designHandle.setProperty(”includeResource”, “MyResources”);
   rr.getDesignInstance().getLabel(”GoodbyeLabel”).textKey = “goodbye”;

… or in the onPrepare event of a label control, you can use:

   this.textKey = “welcome”;

If you are using the REAPI to set the location of the resource file… or assign keys, then you can use code similar to:

   config.setResourcePath(”C:/work/eclipse/BIRT_221/resources”);

   task.setLocale(ULocale.FRENCH); 

   IReportRunnable design = null;
   ReportDesignHandle dh = null;

   design = engine.openReportDesign(”C:/workspace_221/birt/Localization.rptdesign”);
   dh = (ReportDesignHandle) design.getDesignHandle();
 
   LabelHandle mylabel = (LabelHandle) dh.findElement(”LastLabel”);
   mylabel.setTextKey(”welcome”);

All of these examples above can be downloaded from:

http://www.birt-exchange.com/modules/wfdownloads/singlefile.php?cid=2&lid=351


New BIRT Book Available

I saw an announcement for a new BIRT book called “Practical Data Analysis and Reporting with BIRT“. It was written by John Ward who frequently blogs about BIRT on his blog, “The Digital Voice“. I downloaded the eBook version as PDF so I could read it on the plane this weekend to EclipseCon. So far, I’ve only read the introduction, table of contents, and skimmed the rest, but I can see it is written in a tutorial style with lots of screenshots to help along the way. John Graham is also reading this book and has posted a very thorough review of his progress on his blog.

For those of you in the market for books on BIRT, there are also two others available from Amazon at the links below.

BIRT: A Field Guide to Reporting

Integrating and Extending BIRT


Authors