Monday, October 15, 2007

2.2.1 Memory Woes

Show of hands, how many of you have upgraded to version 2.2.1 of BIRT? Okay, now how many of you have had memory issues? Based on my experience and the messages on the newsgroup, it seems like almost everyone that has moved to 2.2.1 through installation of the new All-In-One build is having this problem. Fortunately, there is an easy fix. The problem is related to a change in the Eclipse.ini file. This is a bug on the entire platform and affects all of the Eclipse products, not just BIRT. To fix open the Eclipse.ini file in your ECLIPSE_HOME directory. Find the line with

-launcher.XXMaxPermSize=256m

Replace that line with
-XX:MaxPermSize=256m

That should solve the problem. The platform team is tracking this bug here. They are trying to make a decision
to release a new version of the platform or not. The BIRT team is also tracking the issue here.

Depending on what the platform team does with a new release, we may create a new 2.2.1a build of BIRT so that
this problem does not continue to exist.

Updated: It has come to my attention that there could be a couple of issues.
First) -XX:MaxPermSize=256m has to be the last line in the eclipse.ini
Second) There is only a single dash before the XX:MaxPermSize

Here is the complete eclipse.ini that I am using on my system. I have bumped the memory numbers a bit since I have plenty of RAM on my system.


-showsplash org.eclipse.platform
-vmargs
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m

SR



Monday, October 08, 2007

Introducing BIRT Exchange

I referenced www.birt-exchange.com in an earlier post, but I thought I'd take the opportunity to formally introduce it.

It's a new site, sponsored by Actuate, that provides a variety of content on Eclipse BIRT and the related products and services Actuate has built on top of the open source project.

I particularly like two features of the site. The first is the DevX area, which is a repository of content about BIRT, including sample reports, code, tips and tricks and links to articles and blogs, both on the site and elsewhere. Anyone can access content or add to the repository. Think of it as a sort of del.icio.us just for BIRT.

The second is the Eclipse BIRT newsgroup mirror, which includes all the posts from the Eclipse.org site, but enables you to read and search them using a web-based forum package. I find it a lot easier to locate answers to questions that may have already been addressed using the forum interface.

Next time you're searching for information on a particular BIRT issue or question, keep in mind BIRT Exchange as another good resource.

Thursday, October 04, 2007

EclipseCon 2008 Call For Participation

EclipseCon 2008 is six months away, and it is time to start submitting proposals for talks. I am on the Program Committee and have been given the task of recruiting for the reporting track. This year, I want to have the best possible talks about reporting in the Eclipse environment possible.

There are three types of talks and reporting has been allocated 11 hours of presentation time. Thats a lot of content to come up with, so I need your help. We really want to see members of the BIRT community submitting proposals for talks.

The reporting category is described as:

Topics that show using Eclipse tools and frameworks for business intelligence and reporting applications. In particular, this category is focused on applications of BIRT project components. We are interested in report development, BIRT integration, using the BIRT extension points, and integration of the BIRT Chart components. Preference will be given to presentations that reflect real world experience.

The reporting category has been given 12 slots as shown below:
- 3 Tutorials (2 hours)

- 4 Long Talks (1 hour)
- 5 Short Talks (10 minutes)

Proposals for talks are done through the EclipseCon 2008 submission process.

We are actively recruiting for high quality talks for all three slots. Our goal is to get as much community involvement as possible. You may say, "Whats in it for me". First, you have a chance to receive recognition for all of the great things that you have done with BIRT. Second, the Tutorials and Long Talks allow you to go to the conference for free. Each short talk is worth a 20% discount on your registration.

What are we looking for? We have two goals: First show off as much of the BIRT technology as possible and second show off the actual implementations of BIRT that you are all doing. In terms of the first goal, we have drawn up some broad objectives on the types of talks we would like to see, so any community submitted talks that will help us achieve those goals will have a strong chance of acceptance.

If you have ideas for talks that are not in the objectives, feel free to submit them. We will give careful consideration to all reporting proposals. The presentations are not limited to BIRT, but have to in some way involve Reporting and Eclipse.

The deadline for submissions is the November 19, so please make your submissions as soon as possible.

The BIRT PMC Objectives for EclipseCon talks:

Tutorials (3 allocated two hours each)
* Basic
* Integration / Report Engine
* Integration / Design Engine
* Extension (Data Extension to be covered under Data Tools)
* Charting

Long Talks (4 allocated one hour each)
* Introduction to BIRT
* Customer Success Story
* Advanced BIRT Report Dev (DataCube/Pivot, Expressions, Event Handlers, Libs, and CSS)
* Charting
* Integration (Report Engine / Design Engine)

Short Talks (1 hour – 5 talks allocated ten minutes each)
* Features Hour
o Parameters & Script
o Charts
o Re-Use (Libs & Styles)
o Layout
o Features Q&A

* Customer Hour
o Four stories from our customers on how they used BIRT. (ten minutes each)
o Followed by a joint Q&A with the four customers and one team member.
o customer Q&A

Monday, October 01, 2007

BIRT Web Service ODA

In the August edition of Eclipse Magazine (www.eclipsemag.net) Virgil Dodson and I wrote an article on the use of the Web Service ODA that is new with BIRT 2.2. One option that we discussed was the use of a custom connection class, which allows the developer the option of specifying a class that will be called which will be responsible for retrieving the web service data. In BIRT 2.2 this feature was initially disabled. With the release of BIRT 2.2.1 this week this feature in now enabled. In addition the driver has been improved by adding a driver class path property to locate your custom connection class.



A custom driver class must implement one method named connect. This method should accept two parameters, which contain the connection properties and application context. This class should instantiate another class that implements an executeQuery Method and a close method. The executeQuery method should accept the queryText (SOAP Request), parameter values and data set properties as parameters. In the example from the article this connection class simply opened a FileInputStream which contained a SOAP response and returned the data.


To use this feature, you will still need to provide a SOAP endpoint or a WSDL document when configuring the Data Source. Although the WSDL document can reference methods that may never be called in your custom class, essentially making it a dummy WSDL. In the example you will note that the SOAP request is never used.


An example report and source code using this feature can be found here.


Virgil has also made improvements to the example since it was published , adding pagination and hyperlink controls for navigation which he included in his BIRT Exchange post.


By the way, if you're not familar with it, BIRT Exchange is a community site for BIRT developers that enables you to share code samples, report designs, technical articles, as well as tips and tricks. To read more about the site take a look at this blog.

Wednesday, September 19, 2007

2.2 BIRT Tag Library: Building a Custom Parameter Page

The Web Viewer now contains a tag library that can be used to customize the behavior of the Viewer. This tag library can be deployed by either deploying the viewer as normal or by using the new BIRT Web Deployment project wizard. In addition, if you desire to have BIRT deployed in one context and include the tag library in a separate context this can be done by copying the birt.tld file to your WEB-INF\tlds directory and copying coreapi.jar, modelapi,jar, viewerservlets.jar, engineapi.jar, and com.ibm.icu_3.6.1v20070417.jar from the Viewer libs directory to the new context/web-inf/lib directory. Add the following reference to your web.xml.

<jsp-config>
<taglib>
<taglib-uri>/birt.tld
<taglib-location>/WEB-INF/tlds/birt.tld
</taglib>
</jsp-config>

The following tags are now available:

enlarge

The parameterPage tag can be used to construct your own parameter page before calling the BIRT Viewer. In addition to calling the Viewer several attributes are provided to customize the Viewer appearance and functionality.

For example the following JSP code will present the user with a set of text boxes to enter the two parameters required for the report. The pattern attribute specifies the Servlet mapping to be used and can be set to frameset, run or preview.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>

<birt:parameterPage id="birtParmPage" reportDesign="TopNPercent.rptdesign"
name="my form"
pattern="frameset"
height="600"
width="800"
format="html"
title="My Viewer Tag"
isCustom="true"
showTitle="true"
showToolBar="true"
showNavigationBar="true"
>
TOP COUNT PARAMETER
<input type="Text" name="Top Count">
<br><br>
TOP PERCENT PARAMETER
<input type="Text" name="Top Percentage">
<br><br>
<input type="Submit" value="Run Report">
</birt:parameterPage>
</body>
</html>

If you wish the BIRT Engine to return the HTML it generates for the parameter you can use the paramDef tag in conjunction with the parameterPage tag.

The following code will call the BIRT engine to populate each level of a cascade.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<style type="text/css">
.class1 { background-color:#ff0000; color: #ffffff; }
</style>
<body>

Parameter Page 1
<br>
<birt:parameterPage
id="report1"
name="page1"
reportDesign="cascade_report.rptdesign"
isCustom="true"
pattern="frameset">

Cascading Parameter1: <birt:paramDef id="5" name="Country" />
<br><br>
Cascading Parameter2: <birt:paramDef id="6" name="City"/>
<br><br>
Cascading Parameter3: <birt:paramDef id="7" name="Customer" cssClass="class1"/>
<br><br>
<input type="submit" name="submit" value="Sumbit form"/>
<br><br>
</birt:parameterPage>
<br>
</body>
</html>


This code will produce the following output. Notice that the third level is also being customized by using a style.

enlarge

Download the 2.2 build and try out the new tag library.

Monday, July 30, 2007

BIRT Live Day in Las Vegas

Actuate is hosting the first BIRT Live Day on August 15th in Las Vegas. The event consists of 11 technical sessions divided into two tracks on developing with BIRT and deploying BIRT. I'll be giving a session on "Deploying the BIRT Engine." Some of the other topics include integrating BIRT with the Google Web Toolkit, Internationalizing and Localizing reports and End User Interactivity with BIRT - just to give you a flavor. It's part of Actuate's International User Conference, but you can register just for BIRT Live Day if you want for $150.

Full Agenda and Registration details are here.

Thursday, July 19, 2007

Styles Revisited

Its been a while, but after some family commitments, I am finally back at it with BIRT. In April of 2006, I created a post discussing how Styles could be used within BIRT. With the release of 2.2, it is time to revisit CSS Styles in BIRT. The biggest change is that you can now link to a CSS style sheet, the styles do not need to be imported into the report. This is a HUGE improvement.

To take advantage of this feature you go to the outline view, right click on styles and get the following dialog.


The new option allows you to "Use CSS File". When you select this file a dialog that enables you to select a file.


Once you have attached the CSS file, you will then have access to any of the classes in the CSS file to use as styles within your report. But this is just the beginning. All of the major objects and positions within a BIRT report have a default style associated with them. By modifying the default style settings you can change the look of your report without having to set any styles manually.

The best place to start with the pre-defined styles is to start with the visual objects that make up the report the controls. Each control type has a default style associated with it.
  • text
  • label
  • text
  • data
  • image
  • text-data

So adding the following entry in your style sheet will change the default behavior of all text controls to be orange.
.text{
color: orange;
}

In reality, one should be very careful with how many changes are made to the lowest level styles. Changing a property for a basic control style, will change the style for all instance of that control, unless the control specifically over-rides the property. So if you want all of your text to be orange, by all means modify the base control classes. If on the other hand, you want to modify report style by position within the report, then read on. In other words, if you want the header for all of your tables to look one way and the detail to look another, BIRT provides default classes that control that behavior.

Before moving into the full array of BIRT default classes, I want to expose the CSS properties that BIRT supports. The following table documents the properties and the default property values that BIRT uses.

CSS Property Values | Default | Inherit
background-attachment scroll | fixed | inherit

<color>| transparent | inherit
background-image <uri> | none | inherit
background-position [ [ <percentage> | <length> | left | center | right ] [ <percentage> | <length> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | inherit
background-repeat repeat | repeat-x | repeat-y | no-repeat | inherit
border-top-color , border-right-color , border-bottom-color , border-left-color <color> | transparent | inherit
border-top-style , border-right-style , border-bottom-style , border-left-style <border-style> | inherit
border-top-width , border-right-width , border-bottom-width , border-left-width <border-width> | inherit
color <color> | inherit
display inline | block | list-item | run-in | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit
font-family [[ <family-name> | <generic-family> ] [, <family-name> | <generic-family>]* ] | inherit
font-size <absolute-size> | <relative-size> |<length> | <percentage>| inherit
font-style normal | italic | oblique | inherit
font-variant normal | small-caps |inherit
font-weight normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit
letter-spacing normal | <length> | inherit
line-height normal |<number> | <length> | <percentage> | inherit
margin-right , margin-left <margin-width> | inherit
margin-top , margin-bottom <margin-width> | inherit
orphans <integer> | inherit
padding-top , padding-right , padding-bottom , padding-left <padding-width> | inherit
page-break-after auto | always | avoid | left | right | inherit
page-break-before auto | always | avoid | left | right | inherit
page-break-inside avoid | auto | inherit
text-indent <length> | <percentage> | inherit
text-align left | right | center | justify | inherit
text-decoration none | [ underline || overline || line-through || blink ] | inherit
text-transform capitalize | uppercase | lowercase | none | inherit
white-space normal | pre | nowrap | pre-wrap | pre-line | inherit
widows <integer> | inherit
word-spacing normal | <length>|inherit
vertical-align baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit

Most of you are probably familiar with the standard HTML cascade:
Table
tr
td

A td element will inherit from either the table or the row if it has not defined its own value. If you do specify a property value for the td selector, than it will over-ride the values set at both the row and table levels.

BIRT uses its own cascade precedence. Since each of the major objects and functional positions is assigned a default style. The next table shows the precedence used for the BIRT default styles.

Controls

data

image

label

text

text-data
report

page

grid

list

list-header

list-detail

list-footer

list-group-footer-1

. . .

list-group-footer-9

list-group-header-1

. . .

list-group-header-9

table

table-header

table-header-cell

table-detail

table-detail-cell

table-footer

table-footer-cell

table-group-header-1

table-group-header-cell

. . .

table-group-header-9

table-group-footer-1

table-group-footer-cell

. . .

table-group-footer-9
TOC-level-0
. . .
TOC-level-9

So if you want to change the font-family for all of the controls within your report, then you can use the following within your CSS document.

.report{
font-family: sans-serif;
}

If you want the tables in the report to use italics and a serif font, then you would add:
font-family: sans-serif;

.table{
font-style: italics;
font-family: serif;
}


As you can see, you can control the behavior for headers, detail sections, and footers for list and tables. In addition, each of the group headings can use its own style up to 9 levels deep. In the previous article, I provided a CSS document that was setup to take advantage of this feature. Unfortunately, the Default Style Names have changed between 2.1 and 2.2. I have revised the style-sheet to work with the new default style names.

.report {
font-family : sans-serif;
font-size : medium;
font-weight : bold;
color : #FFFFE0;
}
.table-group-header-1 {

background : #0B285B;
border-bottom : double;
border-top : solid;
border-top-width : thin;
border-color : #FFF8DC;
}
.table-group-header-2 {
background : #13449B;
border-bottom : double;
border-top : solid;
border-top-width : thin;
border-color : #FFF8DC;
font-size : small;
}
.table-header {
background : #6495ED;
border-bottom : double;
border-top : solid;
border-top-width : thin;
border-color : #483D8B;
}
.table-detail {
background : #F0F8FF;
font-size : small;
font-weight : bold;
color : #4682B4;
}
.table-footer {
background : #6495ED;
border-top : double;
border-bottom : solid;
border-bottom-width : thin;
border-color : #483D8B;
font-size : x-small;
}

I am hopeful that in the next edition, I can take a look at adding a bit of code to the report that will do more to automatically assign styles to reports, even if you are using custom styles. I will let you know when I get it done.