Sunday, March 14, 2010

Cleared the SCBCD 5.0 Exam!

I finally cleared the last Java Certification exam that I intend to write - the
Sun Certified Business Component Developer (SCBCD) for the Java Platform, Enterprise Edition 5 Certification Exam (CX-310-091).

It basically is a multiple choice exam
in Java Beans (EJB Edition 3.0) consisting of 61 questions, in which
you have to get at least 36 correct. The low pass score - 59% is reflective
of the difficulty level of this exam.

Here are the topics tested:

EJB 3.0 Overview
EJB 3.0 Enterprise Bean Knowledge
EJB 3.0 Session Bean Component Contract & Lifecycle
EJB 3.0 Message-Driven Bean Component Contract
Java Persistence API Entities
Java Persistence Entity Operations
Persistence Units and Persistence Contexts
Java Persistence Query Language
Security Management

Wednesday, December 2, 2009

Cleared the SCWCD for the Java EE 5 !

I recently cleared the SCWCD (Sun Certified Web Component Developer for the Java Platform, Enterprise Edition 5 certification) exam, an exam for
Sun Certified Programmers who are using the Java technology servlet and JavaServer Pages (JSP) application program interface (APIs) to develop web applications.

I have published my success story in the Java Ranch Forums
with my story. I've also made in the SCWCD Wall Of Frame!

For Those who are interested in pursuing this, here is some extra info:

One must have the Java programmer certification first
- Emphasis is on memorization
– Names of classes, methods, and packages
– Names of JSP variables and associated classes
– Servlet life cycle
– Custom JSP tag libraries
– web.xml elements

Thursday, June 11, 2009

How to override Blank Page template with custom styles

By default, in the BIRT Designer (2.3.1), when selecting a new Blank Report,
you get a report with default(no-styles), and the date/time
at the footer.

If you'd like to modify this template, this can be done quite easily:
A simple way to do this is to modify blank_report.rpttemplate

It is located here:

Now edit the file and add your template. The example below
overrides the crosstab colors/styles and adds a few more custom built styles.


Friday, January 9, 2009

Removing the 'Null' Text in ComboBox or ListBox Parameters

In BIRT 2.3.1, it is possible to modify or hide the 'Null' Text value that is generated
when you create a ComboBox or ListBox Parameter.

*Update to this Post* The syntax highlighter is not working properly.
The XML tag brackets have been replaced with { }

Go to the BIRT WebViewer JSP page in
\webcontent\birt\pages\parameter .

Find ComboBoxParameterFragment.jsp in the viewer and edit the JSP to remove the space and the Null Text Value (i.e. IBirtConstants.NULL_VALUE)

if ( !parameterBean.isRequired( ) )
if( allowMultiValue )
if( DataUtil.contain( values, null, true ) )

{option title="">" SELECTED VALUE=""}{/option}

{option title="">" VALUE=""}{/option}

{option title="">" VALUE="" ??% : ?SELECTED? )? null paramValue="=" {/option}

Sunday, December 21, 2008

Extending the BIRT Google Spreadsheet ODA

I've extended the Dataset UI in the BIRT Google ODA that Scott Rosenbaum posted in BIRT World . The Google ODA utilizes the Google Spreadsheet API and I've extended the UI, by giving a graphical user interface in the custom Dataset page.

From OpenReports

From OpenReports

The Dataset page now initializes a "Google Spreadsheet Model" which contains the
a drop down of the list of available Spreadsheets in the model. Selecting a given
spreadsheet will list the selected Worksheets for that Spreadsheet, and in turn
display the Worksheet-based feed in the form of
I've added a few helper classes to initialize the Spreadsheet in the Dataset UI.
You can actually test this out as I've included the modifieid source code,
and both the designer and ui jars.

Simply take the files:
(Designer UI plugin)
2. org.eclipse.datatools.connectivity.oda.google_1.0.0.jar
(Runtime ODA Plugin)
and place it in the plugins directory of BIRT.

This has only been tested in BIRT 2.3.1, and I currently used JDK 6 to build these jars.
Thanks again toScott Rosenbaum for supplying the initial source code. This example actually helped
me develop my own custom ODA for work.

You can download the ODA Plugin here:

Friday, December 19, 2008

Integrating the Birt Viewer into OpenReports using Struts Part 2

In the last mini-tutorial, we've integrated the BIRT Ajax Viewer 2.3.1 servlet
into OpenReports 3.1, and updated the BIRT libraries from 2.3 to 2.3.1.
In this section, we wrap up the tutorial by basically modifying
the OpenReports UI such that when a BIRT Report is run, we'll get
a UI that allows the additional enhancements:

1. Execute the current BIRT rptdesign report using the BIRT Viewer in the Same Window
2. Execute the current BIRT rptdesign report using the BIRT Viewer in a new Window
Futhermore , we can specify if the BIRT Viewer will be using the Full Window,
or if it will be embeded showing us the Report Name and Path to the Design file.
3. Adding Postscript and Word Export options for BIRT Reports (OpenReports is missing this)

Here are some screenshots of the enhancement and a link to the modified source code here-  
From OpenReports

From OpenReports

I've highlighted the Java files that I've modified using the original OpenReports source code. The perspective below is from Eclipse Ganymede 3.4 which I'm working with.

From OpenReports

We modify struts.xml by adding a new Action called
birtRunReport and create an action class in that extends ActionSupport.
(I've basically mimicked what I've seen with the existing OpenReport Actions
since I'm fairly new to Struts )











Here's the class that I wrote that is used in BirtViewer.jsp where we use
the birt tag library (birt.tld) to run the Viewer.
The birt_isHostPage is an attribute used to indicate if the Viewer will use the whole page.

package org.efs.openreports.actions;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import java.util.Date;
import java.util.Map;
import org.apache.log4j.Logger;
import org.efs.openreports.ORStatics;
import org.efs.openreports.engine.BirtReportEngine;
import org.efs.openreports.engine.ReportEngine;
import org.efs.openreports.engine.ReportEngineHelper;
import org.efs.openreports.engine.input.ReportEngineInput;
import org.efs.openreports.objects.ORProperty;
import org.efs.openreports.objects.Report;
import org.efs.openreports.objects.ReportLog;
import org.efs.openreports.objects.ReportUser;
import org.efs.openreports.providers.DataSourceProvider;
import org.efs.openreports.providers.DirectoryProvider;
import org.efs.openreports.providers.PropertiesProvider;
import org.efs.openreports.providers.ReportLogProvider;
import org.efs.openreports.util.LocalStrings;
import org.efs.openreports.util.ORUtil;

public class BirtReportAction extends ActionSupport
private static final long serialVersionUID = 7473180642590984527L;
protected static Logger log = Logger.getLogger(BirtReportAction.class);
private Map<Object, Object> session;
private String birt_isHostPage; // see birt.tld

private DirectoryProvider directoryProvider;

private Report report;
private String designFile;

public String execute() throws Exception
report = (Report) ActionContext.getContext().getSession().get(ORStatics.REPORT);
designFile = directoryProvider.getReportDirectory() + report.getFile();"BirtReportAction chained - directoryProvider:" + directoryProvider.getReportDirectory());"BIRT Report Action , Report File:" + report.getFile() );"BIRT Report Action , Report Name:" + report.getName() );"BIRT Report Action ), DESIGN FILE:" + designFile );"BIRT Report Action , birt_isHostPage:" + birt_isHostPage);
return SUCCESS;

public String getDesignFile()
return designFile;

public Report getReport()
return report;

public void setBirt_isHostPage(String birt_isHostPage)
this.birt_isHostPage = birt_isHostPage;

public String getBirt_isHostPage()
return birt_isHostPage;

public void setDirectoryProvider(DirectoryProvider directoryProvider)
this.directoryProvider = directoryProvider;

public void setSession(Map session)
this.session = session;


There are 2 JSP's that need to be added/modified that contribute to the UI.
The first is ReportOptions.jsp which is the result of the action associated
with clicking on a BIRT Report.

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="" prefix="display" %>
<?xml:namespace prefix = s /><s:include value="Banner.jsp"></s:include>
<script language="JavaScript" type="text/JavaScript">
function setDefaultExportType()
if (optionsForm.exportType.length)

function setBlankTarget()

function setNoTarget()

function setBlankTargetBirt()

function setNoTargetBirt()


<div align="center">

<a class="back-link img-report-small" href=""><s:text name="link.back.reports"></s:text></a>
<a class="back-link img-group-small" href=""><s:text name="link.back.groups"></s:text></a>

<div class="img-export important" id="instructions" style="WIDTH: 70%">
<s:text name="reportOptions.title"></s:text> <s:property value=""></s:property>

<form class="dialog-form" style="WIDTH: 75%" name="optionsForm" action="reportOptions.action">
<table class="dialog">
<td class="boldText"><s:text name="reportOptions.exportType"></s:text></td>
<s:if test="report.pdfExportEnabled">
<input type="radio" value="0" name="exportType">PDF
<s:if test="report.htmlExportEnabled">
<input type="radio" value="2" name="exportType">HTML
<s:if test="report.csvExportEnabled">
<input type="radio" value="3" name="exportType">CSV
<s:if test="report.xlsExportEnabled report.jXLSReport">
<input type="radio" value="1" name="exportType">XLS
<s:if test="report.rtfExportEnabled">
<input type="radio" value="5" name="exportType">RTF
<s:if test="report.textExportEnabled &amp;&amp; report.birtReport">
<input type="radio" value="6" name="exportType">Text
<s:if test="report.excelExportEnabled">
<input type="radio" value="7" name="exportType">Excel
<s:if test="report.jasperReport &amp;&amp; report.imageExportEnabled">
<input type="radio" value="4" name="exportType">Image
<!-- enhancements to support BIRT export types for BIRT 2.3.1 -->
<s:if test="report.birtReport">
<input type="radio" value="9" name="exportType">MS DOC
<input type="radio" value="10" name="exportType">PPT
<input type="radio" value="11" name="exportType">Postscript

<script language="JavaScript" type="text/JavaScript">

<div class="button-bar" id="buttons">

<input class="standardButton" onclick="setNoTarget()" type="submit" value="<s:text name=" name="submitRun">">
<input class="standardButton" onclick="setBlankTarget()" type="submit" value="<s:text name=" name="submitRun">">
<s:if test="user.scheduler">
<input class="standardButton" onclick="setNoTarget()" type="submit" value="<s:text name=" name="submitSchedule">">

<s:if test="report.birtReport">
<input class="standardButton" onclick="setBlankTarget()" type="submit" value="<s:text name=" name="submitBirtReport">">



<!-- BIRT AJAX Viewer Form -->
<s:if test="report.birtReport">
<div class="img-export important" id="instructions" style="WIDTH: 70%">
BIRT AJAX-Based Report Viewer Output

<form class="dialog-form" style="WIDTH: 75%" name="birtForm" action="reportOptions.action">
<table class="dialog">
<td class="boldText"><s:text name="View Options"></s:text></td>
<input type="radio" value="true" name="birt_isHostPage">Full Window
<input type="radio" value="false" name="birt_isHostPage">Embedded

<div class="button-bar" id="buttons">
<input class="standardButton" onclick="setNoTargetBirt()" type="submit" value="<s:text name=" name="submitBirtReport">">
<input class="standardButton" onclick="setBlankTargetBirt()" type="submit" value="<s:text name=" name="submitBirtReport">">


<s:include value="Footer.jsp"></s:include>

The second JSP we require to modify is BirtViewer.jsp . This is the page
that calls the BIRT Viewer. We use the BIRT Tag library to show the viewer. You can read about it here from BIRT Eclipse site under Using the BIRT Report Viewer

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="" prefix="display" %>
<%@ taglib uri="/birt.tld" prefix ="birt" %>
<!-- refer here for documentation -->


<link href="styles/iv/index.css" type="text/css" rel="stylesheet">
<link href="" type="image/x-icon" rel="shortcut icon">
.warningMessage { color:red; }

<s:textfield label="Report Name" name="report.file"></s:textfield>

<s:textfield label="Design File Path" name="designFile"></s:textfield>
<?xml:namespace prefix = birt /><birt:viewer id="birtViewer" format="html" width="700" height="450" pattern="frameset" reportdesign="${designFile}" ishostpage="${birt_isHostPage}">

That's the core of the work. There are other a few other Java files
that need to be modified to get this example working - they only
involve very minor changes, so I'll just present some snit bit code Fragments.

we need to pass the attribute birt_isHostPage and execute
th Birt Viewer action.

if (report.isBirtReport() && !submitSchedule)
{"This is a BirtReport (aong)");
if(submitBirtReport) {"Submitting BIRT REPORT(aong)");
if (birt_isHostPage != null){"birt_isHostPage" + birt_isHostPage);
} else {"birt_isHostPage" + birt_isHostPage);


The action is defined in

public static final String BIRT_VIEWER_ACTION = "birtReport";

In org.efs.openreports.ReportConstants, we need
to define the new Export Types "DOC", "PPT", and "POSTSCRIPT".

Lastly, we need to add support to the Export types that OpenReports does not
support that the BirtEngine handles in

if (input.getExportType() == ExportType.DOC)

else if (input.getExportType() == ExportType.PPT)

else if (input.getExportType() == ExportType.POSTSCRIPT)


That's about it - bundle the package up , build it and deploy it to Tomcat.

I've enclosed the source code here.  There are two folders enclosed.
1. src folder -> contains all java classes, struts.xml
2. WebRoot -> Tomcat context files.  

*Note* - I've stripped down the WebRoot/WEB-INF folder.
It is missing the lib folder jars that you can get from openReports
(OpenReports 3.1) and the platform folder which contains the BIRT plugins which you can
get from BIRT .   (BIRT 2.3.1 Runtime).  

Download link:  (src files only)

Integrating the BIRT Viewer into OpenReports using Struts Part 1

I wanted to integrate the BIRT 2.3.1 Viewer into OpenReports as a mini-project. The implementation is rather simple, and loose as this was done for a hobby (so nothing professional here) - but hopefully this will help someone out. The final result allows a user in OpenReports to view BIRT reports in the Ajax Based BIRT Web Viewer. I simply utilized the birt tag libraries to deploy the viewer using a simple jsp page.

Since OpenReports uses the Apache Struts 2 Framework, I did a little bit of simple reading on how to configure struts.xml.

Here, I'll give a mini-tutorial on how to get the BIRT Viewer into OpenReports.
The first part of this tutorial will show you how to integrate the viewer into open reports.
I'm using OpenReports 3.1 as of this post and BIRT 2.3.1

1. Download the OpenReports zip file here
2. Download the BIRT 2.3.1 run-time from BIRT here (
3. Next you'll need to update the BIRT Libraries in OpenReports to the one
which you want to deploy and at the same time we need
to integrate the BIRT Viewer by making some changes to the web.xml descriptor file
(In this tutorial, we'll be using BIRT 2.3.1)

a. We'll first copy the comlete directory that contains the BIRT Viewer located in

b. Next take the jar files from the BIRT Web Application in
and carefully copy and replace the old BIRT libraries (2.3.) in
Open reports found in openreports-tomcat\openreports\WebRoot\WEB-INF\lib

b. We need to also port the plugins, tlds, and web.xml to Open Reports.
Copy and integrate the following files from BIRT :



For the OpenReport web.xml file, make sure you add the following entries



































In part 2 of this tutorial we'll integrate the Viewer into the UI.