Anda di halaman 1dari 17

Date: 12/21/2017 Page: 1 - 17

BIRT Overview

Report Introduction

BIRT is an Eclipse-based open source reporting system for web applications, especially those based on Java and J2EE. BIRT has two
main components: a report designer based on Eclipse, and a runtime component that you can add to your app server. BIRT also offers
a charting engine that lets you add charts to your own application.

The current released version is 2.1.2. We encourage you to download BIRT, try it, and give us your feedback though the newsgroups
and Bugzilla.

With BIRT, you can add a rich variety of reports to your application.

 Lists - The simplest reports are lists of data. As the lists get longer, you can add grouping to organize related data together
(orders grouped by customer, products grouped by supplier). If your data is numeric, you can easily add totals, averages and
other summaries.
 Charts - Numeric data is much easier to understand when presented as a chart. BIRT provides pie charts, line & bar charts
and many more. BIRT charts can be rendered in SVG and support events to allow user interaction.
 Crosstabs - Crosstabs (also called a cross-tabulation or matrix) shows data in two dimensions: sales per quarter or hits per
web page. (Crosstabs are not yet in Release 2.1.2, but are planned for the 2.2 release.)
 Letters & Documents - Notices, form letters, and other textual documents are easy to create with BIRT. Documents can
include text, formatting, lists, charts and more.
 Compound Reports - Many reports need to combine the above into a single document. For example, a customer statement
may list the information for the customer, provide text about current promotions, and provide side-by-side lists of payments and
charges. A financial report may include disclaimers, charts, tables all with extensive formatting that matches corporate color
schemes.

The Anatomy of a Report

BIRT reports consist of four main parts: data, data transforms, business logic and presentation.

 Data - Databases, web services, Java objects all can supply data to your BIRT report. Release 2.1.2 provides JDBC and XML
support, as well as support for using code to get at other sources of data. BIRT's use of the Open Data Access (ODA)
framework allows anyone to build new UI and runtime support for any kind of tabular data. Further, a single report can include
data from any number of data sources. BIRT also supplies a feature that allows disparate data sources to be combined using
inner and outer joins.
 Data Transforms - Reports present data sorted, summarized, filtered and grouped to fit the user's needs. While databases can
do some of this work, BIRT must do it for "simple" data sources such as flat files or Java objects. BIRT allows sophisticated
operations such as grouping on sums, percentages of overall totals and more.
 Business Logic - Real-world data is seldom structured exactly as you'd like for a report. Many reports require business-specific
logic to convert raw data into information useful for the user. If the logic is just for the report, you can script it using BIRT's
JavaScript support. If your application already contains the logic, you can call into your existing Java code.
 Presentation - Once the data is ready, you have a wide range of options for presenting it to the user. Tables, charts, text and
more. A single data set can appear in multiple ways, and a single report can present data from multiple data sets.

Step-by-Step BIRT Tutorial We'll create a simple customer listing report, with the
customers grouped by state and city. For each customer, we'll
Step1 display a name and phone number.

 Introduction
Install BIRT
Introduction
If you have not yet done so, install Eclipse, GEF, EMF and
This brief tutorial walks you through building a simple report with BIRT. You'll find complete instructions for doing so on the BIRT
BIRT. It introduces the major UI features, and many of the BIRT Install page.
reporting elements. At the completion of this tutorial, you should be
able to start building your own reports using your own database.
Date: 12/21/2017 Page: 2 - 17
Open BIRT  Click Next.

BIRT is a perspective within Eclipse. To open it, use the Window You can create a report in three ways: as a blank report, by
item on the Eclipse main menu. Choose Open Perspective, then using a BIRT-defined template, or by copying one of your
Report Design. If report Design does not appear directly in the report designs. In this tutorial we will use a Template descibed
Open Perspective window, then choose Other... A list of in the next section.
perspectives will appear. Choose Report Design.
Choose a Template
Eclipse will switch to display the BIRT perspective.
The next page of the New Report dialog presents a selection of
Example Report report templates. Before we choose the one we want, let's walk
though what's available.
If you get stuck as you work through the tutorial, or if you want to
see the finished report right away, simply download it:  My First Report - Starts a report template that takes
you through a tutorial using on-line help. (That tutorial
 Use your browser to download the report: will eventually replace this one.)
customers.rptdesign.  Blank Report - Creates a blank report with no
 Save the file into an Eclipse project directory. (See the predefined content.
next page if you don't yet have a project.)  Simple Listing - A tabular listing with no grouping.
 Your browser may store this as an XML file. If so, rename  Grouped Listing - A tabular listing with grouping.
it back the the name above. Grouping shows repeated values just once. Grouping
 Within Eclipse, select your project in the Navigator view also allows you to create subtotals.
and choose Refresh from the right-click context menu.  Dual Column Listing - Produces a listing with two
 Double-click the report to open it in the BIRT report columns side-by-side.
designer.  Chart & Listing - A tabular listing that adds a chart to
the top of the report.
Step2  Dual Column Chart & Listing - Combines charts and
tables so you can display two sets of related data in a
single report.
 Create a Project
 Side by Side Chart & Listing - Creates a grouped
 Create a Report report where each group contains a chart and a listing
 Choose a Template side by side.

Create a Project We're now ready to choose our template:

Eclipse uses projects to organize your files. So, the first step is to  Select the Grouped Listing.
create a new project. For this demo, let's create a project called
 Click Finish.
"My Reports":

BIRT opens your new report in the Eclipse workspace.


 Choose File→New→Project. The new project dialog
appears.
Step3
 Open the "Business Intelligence and Reporting Tools"
group and choose "Report Project".
 Click Next.  Brief UI Tour
 Type "My Reports" (without the quotes) as the project  Cheat Sheets
name.  Layout Editor
 Click Finish.  Views
 Click OK if asked to switch to the Report Design  Displaying Views
perspective. (This occurs if you create a BIRT project
while in a perspective other than Report Design.) Brief UI Tour

Create a Report Before we start work on the report, let's take a quick tour of the
UI. We'll be looking at most of the UI in detail as we build our
We're now ready to create our first report: report.

 Choose File→New→Report. The new report dialog Cheat Sheets


appears.
 In the tree view, choose the project we just created: My Notice at the right of your Eclipse workspace (for the default
Reports. configuration) is a view called "Cheat Sheets." This view walks
 Enter the following in the file name field: you though the process of building a report based on the
Customers.rptdesign. template you selected.
Date: 12/21/2017 Page: 3 - 17
For now, let's go ahead and close that view by clicking on the X  About Data Sources and Data Sets
(close) button in the upper left corner of the view, since we'll be  Build a Data Source
following the steps in this tutorial.
 Editing your Data Source

Layout Editor
About Data Sources and Data Sets

The central area is the Layout Editor. This is the place where you
BIRT reports use a data source element to connect to a
create your report design. The editor has five tabs:
database or other data provider. BIRT uses a data set element
to retrieve data from the data provider. Think of the data source
 Layout - Where you edit your report design. as a connection, and the data set as a query.
 Preview - Runs your report and shows the output.
 Script - Where you add JavaScript to your report to Build a Data Source
customize its behavior.
 XML Source - You can view and modify the XML source of Let's build our data source:
a report from here.
 Master Page - Used to format page data such as page
 Open the Data Explorer View, if it is not already
headers.
visible.
 Select the Data Sources node within the tree view.
Views
 Right-click to open the context menu.
 Choose New Data Source. The New Data Source
Around the editor are a number of views: The views below can be dialog appears.
arranged to the left, right or bottom of the Layout Editor
 Choose Classic Models Inc. Sample Database.
 In the Data Source Name field, enter "Sample".
 Palette - BIRT View that shows the standard report items  Click Next.
you can add to your report using drag & drop.
 Click Finish.
 Outline - BIRT View that shows the structure of your report
as a tree view.
 Navigator - Standard Eclipse view that shows your Your new data source appears within the Data Sources node in
the Data Explorer.
projects, and the reports within your projects.
 Data Explorer - BIRT View that shows your data sources
(connections), data sets (queries) and report parameters. Editing your Data Source
You also use this view to add data set columns to your
report layout. For future reference, let's review how you would go about
 Property Editor - BIRT View that displays properties for changing the data source:
many report items. It has tabs and groupings that organize
properties into categories.  Find or open the Data Explorer View.
 Properties View - Standard Eclipse view that shows all  Open the Data Sources node.
properties for a report item as a simple list. This view is
optional, and we will not use it in this tutorial.  Double-click the data source.
 Library Explorer View - BIRT allows the reuse of report  The Data Source editor opens. You can make any
objects, such as tables, data sources and styles. Objects needed changes.
created for reuse are stored in a library file. The Library  Click OK to save your changes.
Explorer will display Libraries that exist in the resource
folder. Developed libraries can be added to the resource Step5
folder by selecting File→Publish Library to Resource
Folder or by right clicking in Library Explorer and selecting
add. The resource folder location can be configured at:  Build a Data Set
Window→Preferences→Report Design→Resource.  Data Set Editor Pages
 Database Browser
Displaying Views  Create the Query
 Test the Query
You can arrange your views any way you like. You can also hide  Edit a Data Set
them by clicking the "X" button next to the view tab. If you
accidentally hide a view, you can display it again by using the Build a Data Set
Window→Show View menu item.
Now we're ready to build and test our data set.
Many people find that a convenient layout is to have the Palette,
Navigator, Outline and Data Explorer docked at the left edge of
your workspace, and the Property Editor and Properties view  Find or open the Data Explorer view.
docked at the bottom of the workspace.  Select the Data Sets node in the tree view.
 Right-click to open the context menu. (We'll just say
Step4 "open the context menu" or "choose x from the
context menu" from now on.)
Date: 12/21/2017 Page: 4 - 17
 Select New Data Set. The New Data Set dialog will  This editor support drag and drop.
appear.
 Enter "Customers" for the Data Set Name field.
 Ensure that the Data Source field shows the Sample data
source created above. Test the Query
 Ensure that the Data Set Type field shows "SQL Select
Query".
With the data set editor open, do the following:
 Click Next.
 Enter the following Query:
SELECT *  Click on the Preview Results item.
FROM CUSTOMERS
WHERE COUNTRY = 'USA' The preview page appears. This page shows the columns
 Click Finish. selected in your query listed across the top. The actual rows in
your query appear down the page.
Data Set Editor Pages
 Verify that the list of customers appears.
The data set editor now opens. Let's take a look at the pages within  Click OK to close the data set editor.
this editor. The data set editor provides the following pages:
If an error dialog appears, check the following:
 Query - Displays your SQL SELECT statement. This is
where you create and change your SQL query. Once you  Your Eclipse is installed in a directory without spaces.
have the basic query, you can add a WHERE clause,  You have typed the SQL statement as shown above.
adjust the set of selected columns, and more. Use the
SQL editor to add computed columns that are to be
 You have not put a semi-colon at the end of your
calculated by the database engine. Give such columns a statement.
name using the SQL ALIAS clause.
 Data Source - Displays the name of the data source for Edit a Data Set
this data set so you can view or change it.
 Preview Results - Lets you test your query and see the Your new data set appears in the Data Explorer along with your
output. Very handy to make sure that the data is right data source. We can use the data set editor to change the data
before you proceed with report design. set, and to test it to make sure it returns the correct data.
 Computed Columns - Computed columns are calculated
by BIRT and appear to the rest of the report just like any  Find or open the Data Explorer.
other column. You can use JavaScript expressions, and  Open the Data Sets node.
even call into Java for advanced business logic.
 Double-click the Customers data set. The Data Set
 Parameters - SQL SELECT statements can include input
editor opens.
parameters that pass data into the query. They are marked
using the SQL "?" symbol in the query. This page lets you
give the parameters a name, a default value, and so on. Step6
There must be a one-to-one correspondence between
entries on this page and the "?" symbols in your query.  Report Layout
 Filters - Additional filters that BIRT applies to your data.  Report Items
Filters restrict the data passed to the report. The WHERE
 Create the Table Detail
clause is also a filter: one executed by the database. This
tab lets you define additional filters using BIRT  Create the State Group
(JavaScript) scripting.  Create the City Group
 Output Columns - Shows the columns within the query,  Add a Table Column
and lets you define a column alias for use in the report.  Create Column Headings
Note that this view shows the columns as the report will
see them. The Query page shows the columns as Report Layout
selected from the database.

Our customer listing report will display customer information in


Database Browser the form of a table: just like an HTML table, with the added
ability to iterate over report data. The Grouped Listing template
Switch to the Query page if you're not already there. This page we chose earlier created the table for us, we just need to fill in
provides a simple database browser. the details. Before we do, let's introduce the various BIRT
report items.
 Expand the Sample data source to see the schemas
within this database. There is only one: Report Items (Elements)
"CLASSICMODELS".
 Expand "CLASSICMODELS" to see the list of tables in the BIRT provides a variety of report items or Elements for use
database. when creating your report. Report items appear in the Palette
 Expand a table to see its columns. view. Report items include:
Date: 12/21/2017 Page: 5 - 17
 Label - Displays a simple piece of text such as "Customer Create the State Group
Name".
 Text - Text that can include HTML formatting and We want our customer listing to be grouped by state, then city.
computed values. Used to create headings, form letters, Using a group causes all rows within the same state to appear
"mail-merge" effects, etc. together. Let's create the group header for states:
 Dynamic Text - Displays a database column that can
contain HTML formatted (CLOB) data. Allows for  Locate the group header row in your table. It has a
advanced CLOB data manipulation through expressions. light gray "Group Header Row" label.
 Data - Displays a database column or a computed value.  Drag the STATE column into the leftmost cell within
Provides formatting. the Group Header row.
 Image - Any kind of image supported by a web browser.
Images can be embedded in the report, referenced
Creating Groups on your Own
through a URI, read from the resource folder or retrieved
from a BLOB field in a data set.
 Grid - Provides a tabular arrangement of report items, We are using the group created for us by the New Report
much like an HTML table. This element doesnt iterate over dialog. If we'd started by dragging the table from the palette,
data sets like a List or a Table. we'd create this first group as we'll explain in the next section.
 List - Presents data from a data set in any kind of format.
Used when the layout for each row is more sophisticated You must bind (associate) the table to a data set before you
than a simple table row. This Element will iterate over a can create a group. The binding happened automatically when
bound Data Set. we dropped the first data set column into the table. However, if
 Table - Presents data from a data set in the form of a you build a table on your own, you can use the Binding tab in
table. Can contain grouping levels. Like an HTML table the Property Editor to bind the table to a data set.
that has a table row for each data set row. This Element,
like a list will iterate over a bound Data Set. Create the City Group
 Chart - Displays a business chart such as a pie chart, line
chart, etc. Next, we'll create a city group within the state. This groups
customers first by state, then by city.
This tutorial will use all the elements except for List, Chart and
Dynamic Text.  Hover the cursor over the table and a Table tab will be
displayed.
Create the Table Detail  Click on the Table tab to display the table scaffolding.
 Select the Property Editor→Binding Tab. You will see
The New Report dialog created a starter report that contains a table that the Table is bound to the Customers Data Set.
item with one level of grouping. If we'd chosen a blank report, we Under Data Column Binding you will notice the three
could create the table simply by dragging it from the palette. Table columns that have already been created.
 Select Add. Then Data Binding dialog will be
The next step is to add content to the table. We'll start with the displayed.
detail band which repeats to display each row from our data set.  Enter City in the Name field and select ellipse next to
Here's how: Expression. The BIRT Expression Builder will be
displayed.
 Display the Data Explorer if it's not already visible.  Select Available Data Sets under Category,
Customers under Sub-Category and then double-click
 Expand the Data Sets node of the tree.
on the CITY column.
 Expand the entry for the Customers data set that we
 Select OK and change the Binding name from New
created. This will display the columns available from the
Binding to CITY. The Data Set Row column CITY is
data set.
now available to be used within the Table.
 Select the CUSTOMERNAME column.
 Right-click on the row header for the state group
 Locate the detail band within the table. (It is has a gray header and a context menu will be displayed.
"Detail Row" label.)
 From the context menu choose Insert Group→Below.
 Drag the CUSTOMERNAME column into the detail band The Group Details dialog appears.
cell second from the left. This operation adds a Data
 Chose the CITY column in the Group On field and
Element and a Label Element to the Table Element. The
type City in the Name field.
Binding Editor maps the Data Element to the Data Set row
column CUSTOMERNAME. The Binding Editor is  Click OK.
available by selecting the Binding tab in the Property
Editor for the Table. You can change this value by Notice that BIRT automatically inserted a Data element for the
selecting the ellipse next to the expression within the city group.
Binding Editor. You will now see that the Table Element
contains the new Label Element and the new Data Add a Table Column
Element.
 Drag the PHONE column into the rightmost cell of the
We need another table column to display our group heading:
detail band.
Date: 12/21/2017 Page: 6 - 17
 Ensure the table scaffolding appears. Right-click on the The Preview tab is handy for a quick review of your report.
shaded column header for the first column. BIRT runs the report each time you switch to Preview.
 Choose Insert→Column to the Right from the context However, you can have either the Layout or the Preview tab
menu. A new column appears. open, but not both.
 Move the CITY Data Element (the Element in the first
column of the second group header) to the second column Instead, we can preview the report in a separate window. Find
of the second group header by dragging it. the Preview button in the toolbar. Use the little arrow next to it
to open the pull-down. You can then Preview as HTML in a
separate window. This allows you to switch back and forth
Create Column Headings
between your layout editor and your preview without rerunning
the report.
We're almost done with the basic setup of our table. We just need
to refine our column headings. BIRT added headings for us for
Preview in Web Viewer
each column we added to the table.

This option is similar to the one above. It allows the report to


 Double-click on the first column header text to change it. be previewed as HTML in a separate browser window using
Type "State" and press Enter. the BIRT Web Viewer. The viewer provides powerful navigation
 Drag a label from the palette into the second column capabilities such as TOC, Previous Page, Next Page, Goto
heading, type "City" and press Enter. Page as well as search and export capabilities.
 Change the third column header to "Name".
 Change the last column header to "Phone". To preview the report in the Web Viewer use the toolbar
Preview button and select the Web Viewer option or
Step7 alternatively invoke File->Preview in Web Viewer.

Preview as PDF
 Test your Report
 Preview as HTML
You can also choose Preview as PDF. This converts the layout
 Preview as PDF
to a multi-page PDF format.

Test your Report


Step8

We're now ready to test the report layout. We verified the data set
earlier, so now we want to verify that the report is presenting the  Resizing Table Columns
data as we expect.  Setting the Background Color
 Setting the Font
We preview the report by clicking on the Preview tab in the lower  Formatting Data
left corner of the report editor. This report has no parameters, but if  Setting a Border
it did, they could be modified by selecting the Show Report  More on Properties
Parameters button.
Resizing Table Columns
The window that appears is an embedded web browser, which
displays the report in HTML format. The report appears as a single
page. This works best for smaller data sets. Since the sample Let's adjust the size of the table columns. Tables & columns
database has quite a bit of data, we used a WHERE clause to limit can be sized using absolute sizes (inches, centimeters), or
the results. We could also use a report parameter or a data set filter relative sizes (percentage of the width of the page.) Here, we'll
to limit the amount of data displayed at any one time. adjust the column widths by directly changing them in the
report layout. To do this:
There are a number of ways we can improve the report's
appearance:  Click the Layout tab to switch back to the report
layout.
 Display, then click on the table tab to display the
 Add a title to the top of the report.
"scaffolding."
 Add some color to enhance the column headings.
 Find the black line that separates the "City" and
 Shrink the size of the city and state columns. "State" column headings.
 Add some color to make the state and city group headers  With the cursor over this line, hold down the left
stand out. mouse button and resize the column to be about big
 Format the phone numbers. enough to hold the two-letter state code and label.
 Sort customers by name.  Repeat the above to resize the city column.

Before we apply these aesthetic enhancements, let's look at other Setting the Background Color
ways to preview the report.
Let's dress up the state heading by setting the row's
Preview as HTML background color. To do this:
Date: 12/21/2017 Page: 7 - 17
 Select the state group header row (first group header) by  Set the Color field to a black. (Use the color name
clicking on the shaded box to the left of the row. pull-down, or choose the bottom left color in the color
(Remember to display, then click on the table tab to picker.) (This is the default.)
display the scaffolding.)  Set the Width property to the thinnest line.
 Locate or open the Property Editor.  Click the top, bottom, left and right border buttons. A
 A list of property types appears at the left of the view. Click thin border appears around the table.
on the General group.  Switch to the Properties view (Window->Show View-
 Find the Background color field. Click on the empty gray >Properties) to specify that a wider border should be
button to display the color picker. used for the bottom and right sides.
 Pick the blue color third from the right in the top row. This  Click on the table tab to initialize the Properties view
is a standard color, but is a bit too dark for our needs. with the table’s properties.
 Click on the "Define Custom Colors" button.  Expand the Box node in the Properties View and set
 Take the right-most slider (saturation) and move it up to the Border bottom width and Border left width fields to
produce a very light blue. medium.
 Click OK.
More on Properties
Setting the Font
BIRT provides a wide variety of properties for formatting report
Now, let's give the state a bold font. We'll also dress up the city items. The properties are based on the W3C CSS (Cascading
group heading by giving it a dark blue, bold, larger font. To do this: Style Sheet) standard. If you've ever used CSS to format
HTML, you are well on your way to understanding formatting in
BIRT.
 Select the state Data Element. (it’s located below the state
label.)
Step9
 Switch to the General property group in the Property
Editor.
 Find the Font size field. Change the size to "Large".  About Data Properties
 Click the [B] (bold) button to make the font bold.  Setting the Detail Sort
 Select the city Data Element.
 Again, switch to the General property group. About Data Properties
 Set the font size to Large.
 Click on the Font Color button. In addition to the visual properties we just saw, BIRT provides
a set of data-related properties for each report item. We'll use
 The color chooser again opens. Again choose the blue these to control the sort order of the customers within our
that is third from the right in the top row. report.
 Click OK.
Data sets in BIRT are reusable: you can use the same data set
Formatting Data multiple times. For example, suppose you want to show year-
to-date (YTD) sales three ways: by month, by sales rep, and as
We want to format the phone numbers so that they have correct a chart. With BIRT, you define the data set once, but present it
North American format: (123) 555-1212. We do this by applying a three times. Each use of the data set can provide data
string format to the phone number field. Formats are also available properties that customize the data set to that particular use.
for dates and numbers.
Data properties include:
 Select the phone number Data Element.
 Switch to the Format String page in the Property Editor.  Data set binding: lets you specify the data set to use
 Choose Custom for Format String as. with any given report item.
 Choose Phone Number from the list.  Parameter binding: you can pass data into the data
 In the Format Code field, add a space after the closing set. For example, you can create a "master/detail"
parenthesis to produce the following: subreport by using data set parameters to pass data
from the current row in the master report to the detail
for the subreport. Or as another example, you can
(@@@) @@@-@@@@ obtain a list of customers from one database, then
have the subreport display orders from a different
Setting a Border database.
 Filters: provide filter conditions unique to a given
Next, let's put a "drop shadow" border around our table. presentation. For example, a list of transactions might
list all transactions, but then use filters to display
sales in one chart, returns in another.
 Click on the table tab.
 Groups: provide ability to create subtotals as we have
 Select the Borders page in the Property Editor. already seen.
 Set the Style field to a solid line. (This is the default.)  Sorting: controls the order of the detail rows within a
table. This is the property we'll use.
Date: 12/21/2017 Page: 8 - 17
Setting the Detail Sort Applying a Style

We're ready to specify the sort order for customers within our Next, let's apply the style to the other three header labels. (We
report. could have done this in a single step by selecting all four when
we defined the style. We're doing it in two steps just to show
how it's done.)
 Select the table. (by clicking on the table tab in the Layout
Editor.)
 Choose the Sorting tab within the Property Editor. (Note:  Select the other three labels: click on the City label,
Sorting is a tab on the top of the Property Editor and not a then use Ctrl+click to add the other two to the
page on the left as we've used thus far.) selection.
 Click the Add button to add a new sort condition.  Choose Style→Apply Style→Header from the context
 Use the pull-down under Sort Key to choose menu.
"CUSTOMERNAME".
 Leave the Sort Direction at Ascending. The other three cells are now also formatted.

Step10 Editing a Style

 About Styles Suppose we wanted to change the style we just created.


Here's how we find and change it.
 Creating a Style
 Applying a Style
 Editing a Style  Find or open the Outline view.
 Scroll down to the bottom and find the Styles node.
About Styles  Open the Styles node to reveal our styles.
 Double-click the style you want to edit.
We mentioned that BIRT uses CSS to define the styles for report  You can also edit a style by selecting Style→Edit
items. BIRT also allows you to define the properties in a style sheet, Style→Style Name from the context menu when a
then to apply the style to a report item, just as in HTML. The result report item is selected.
is that you create the style once and use it multiple times. If you
need to change the look of a report, you can change the style in Step11
one place rather then in many different report items. If you've
defined your own styles when creating HTML pages, you're well on
 About Style Cascade
your way to understanding the BIRT style system. Styles can also
be placed into BIRT libraries (Using Themes) and shared across  Setting Report-Wide Properties
reports.  Other Default Styles
 Check the Report
Creating a Style
About Style Cascade
Let's use the style feature to format the table header. Let's make
the table header a blue bar with contrasting text. Instead of We've mentioned that BIRT uses CSS to define the styles for
formatting each label one-by-one, we'll define a style, then apply it. report items, and we saw how to define and apply our own
To do this: style. BIRT also follows the "cascade" part of Cascading Style
Sheets: you can set a property once for the report, or a
container, and have that value cascade down through the
 Select the first label (State label) in the Table Header
contents of the container.
band.
 Right-click and select Style→New Style from the context
menu. In BIRT, Grid, List and Table items are containers: they can
hold other report items. The report itself is the ultimate
 The Style Properties dialog appears.
container for all report items.
 Enter "Header" in the Custom Style (Name) field on the
General page and make sure that the Custom Style radio
button is selected. Setting Report-Wide Properties
 Switch to the Background page from the left most column
of the New Style dialog. Our report currently uses the default font: a serif style.
 Click the Background color button and choose the same (Actually, by default BIRT uses the font set in your browser.
blue: third from the right in the top row. Many browsers use a serif style by default, but if you've
changed your default browser font, that is how the report will
 Switch to the Font page.
appear.)
 Set the Color to white.
 Set the Weight to Bold.
Let's use a sans-serif style instead. We do this by using a pre-
 Click OK. defined BIRT style called report, which specifies the default
style for report items. If you are familiar with CSS, this is like
Notice that the new style has been applied to the label. defining a style that selects the HTML body tag.
Date: 12/21/2017 Page: 9 - 17
 Open or locate the Outline view. the work to make it happen. In this case, we want a one-row
 Scroll down to the bottom to find the Styles node. grid with three columns each 1/3 the width of the page.
 Open the Styles node.
 Right-click and select New Style.  Drag a Grid item from the palette into your report
 From the General page, check the Predefined Style radio above your table. The Insert Grid dialog appears.
button and select “report” from the associated drop down  Choose 3 columns and 2 rows.
list.  Click OK.
 Click OK
 Go to the Styles node in the Outline view and find the style Row Properties
named "report". Double-click it to open the Style editor.
 In the Font page, choose "sans serif" as the font type. We want the contents of the header to be top-aligned. And we'll
 Click OK. use the second row as a spacer between the header proper
and the report body:
All items in your report will change to sans-serif font.
 Select the entire first row of the Grid that you just
The names "serif" and "sans-serif" are defined by CSS: they are added.
generic font styles that don't depend on the specific fonts installed  In the General page of the Property Editor, set the
on a machine. CSS generic font names avoid dependencies on vertical alignment to Top.
specific fonts installed on the browser machine; something that is  Select the second row.
important if your reports will be appear as part of a public web site.  In the General page of the Property Editor, set the
You can also use font lists as in CSS. For example: "Helvetica, height to 0.25 in.
Arial, sans-serif".
Column Properties
Other Default Styles
We want each of the three columns to be 1/3 the width of the
BIRT defines default styles for most report items and for list and page, and we want them to be left, center and right aligned:
table bands. See the ROM Styles Specification for the complete list.

 Select the first column header.


The Styles node displays the styles that apply to each of the report
items. However, there are additional styles that apply to grouping  Switch to the General tab in the Property Editor.
levels and other contexts. If you wish to use one of these, simply Notice that the width is unset. As in HTML, if the
create a style with the required name. column width is not set, BIRT will size the column to
its content.
 Set the column widths to 33%. Do this by typing "33"
Check the Report
in the width field, then selecting "%" from the adjacent
pull-down.
Let's click the preview tab to see how our report looks after the  Select the middle column.
formatting. Not bad, but we still need a better report heading.
 Repeat the step above to set the width to 33%.
 In the General page of the Property Editor, set the text
Step12 alignment to Center.
 Select the rightmost column.
 Create a Grid  Repeat the step above to set the width to 33%.
 Row Properties  In the General page of the Property Editor, set the text
 Column Properties alignment to Right.
 Insert an Image
 Insert the Run Date Insert an Image

Create a Grid Let's click the preview tab to see how our report looks after the
formatting. Not bad, but we still need the report heading. To do
Let's add a suitable heading to our report. It will use the classic this:
"left/center/right" layout: a logo on the left, the report title in the
center, and the run date on the right. Before you do this you may  Drag an Image item from the palette into the left-most
want to remove the current basic heading, which simply says cell of your grid.
“Report Header”. To do this:  The Image Builder dialog appears.
 Ensure that the URL radio button is selected.
 Select the Grid item containing the “Report Header”which  Enter the following URL:
is located above your table. "http://www.eclipse.org/birt/phoenix/tutorial/basic/multi
 Delete it by right-clicking on it and selecting the delete chip-4.jpg". (don’t forget to add the quotes.)
option from the context menu.  Click the Preview button to ensure that the URL is
correct.
The easiest way to create such a layout is to use a grid. A grid is  Click Insert to add the image to your report.
like an HTML table, it tells BIRT the desired layout, and BIRT does
Date: 12/21/2017 Page: 10 - 17
You can also embed an image from your local disk. Embedding the  From the list near the top of the dialog, insert a
image copies the image into the report design. Using a URL is more <FONT> element.
efficient.  In the attributes provided, set the size to 6 and the
color to blue. Erase the face attribute. The text should
Insert a Run Date now look like this:

Next, let's display the current date in the right-most cell in the <CENTER>
heading. To do this: <FONT size="6" color=blue>

</FONT>
 Drag a Data item from the Palette into the right-most cell
</CENTER>
of your grid.
 Continue using the editor to create the text below:
 The New Data Item dialog will be displayed. Change the
name to current_date.
 Set the Data Type column to Date Time. Select the ellipse <CENTER>
next to the Expression. The expression builder will appear. <FONT size="6" color=blue>
Customer Listing
 Type "new Date( )" (without the quotes) to display the
</FONT>
current date.
<BR>
 Click OK. <I>For internal use only</I>
 Set the date format. Select the Format DateTime page </CENTER>
within the Property Editor.  Click OK and save your changes.
 Choose the date format that looks like this: May 12, 2005.
(The actual date will be today's date.) This is the BIRT
Dynamic Text
"Medium Date" date format.

While we won't use it in this tutorial, there is one other feature


BIRT uses Java formatting for dates, numbers and strings. In
of Text Elements to note. Select the Dynamic Text category
addition, BIRT adds a number of specialized, locale-aware date
and you'll see a tag. This allows you to insert expressions
formats described in the ROM Styles Specification.
directly into your HTML. For example, to display an address
line in US format, we could type:
Step13
<value-of>row["city"]</value-of>,
 About Text Items <value-of>row["state"]</value-of>
 Create a Text Item <value-of format="@@@@@-@@@@">row["zip"]<value-of>
 Dynamic Text
 Final Test The row values correspond to the name column within the
Binding Editor for the given report container element. So for
example if we added a Text Element to our Table, we could use
About Text Items row["CUSTOMERNAME"] within the value-of tag.

The final step in our report is to create the actual header text. We Final Test
want it to look something like this:
We're now ready to give the report a final test. Click the
Customer Listing Preview tab to see the report with formatting applied.
For internal use only
Step14
We could create this with two labels. But, we'll take this opportunity
to try out the Text element which allows us to use HTML formatting
within the text.  Wrap Up
 Next Steps
Create a Text Item  More Information

Let's create our text item. To do this: Wrap Up

 Drag a Text Element from the palette and drop it into the In this tutorial we created a simple listing that touched on many
center cell within our grid. of the features of the BIRT Report Designer and Report Object
 The Edit Text Item dialog appears. Model (ROM). Now that you are familiar with BIRT, you're
ready to learn more about it.
 In the top combo box, choose HTML/Dynamic Text. The
dialog displays a variety of HTML tags we can insert.
Next Steps
 Using the button next to Formatting, pull down the list and
choose Layout.
 Click the <CENTER> tag to add it. Additional BIRT topics include:
Date: 12/21/2017 Page: 11 - 17
 Charting with interactivity  Payments: Payments made by customers against
 Scripting and Expressions using JavaScript their account
 Custom data access extensions  Products: The list of scale model cars
 Advanced formatting  Product Lines: The list of product line classifcation
 Advanced queries
 Multi-part reports (multiple lists, side-by-side lists, master- This ER-diagram shows the table structure and relationships.
detail reports, etc.) (PDF version)
 Conditional formatting
 Extended data items Install
 Dynamic and cascaded parameters
 Joined Data Sets The sample database is available in two forms:

More Information  Apache Derby database, which is included in the


BIRT download
A number of resources are available to help you learn more:  Scripts to load a MySQL database

 The extensive online help included within BIRT. Select The scripts to load a MySQL database are contained in the
Help→Help Contents from the Eclipse menu and then sample database zip file. This zip also has documentation and
click on the BIRT Developer Guide. logos for the sample database.
 Reference material, including ROM (Report Object Model)
specifications. MySQL Version
 Additional example reports.
 BIRT newsgroup To install the MySQL version of the sample database, you must
 How to get help on using BIRT. have MySQL installed. See mysql.com for instructions.

Install the MySQL JDBC driver into BIRT:


 Download and unzip MySQL Connector/J 3.1 JDBC
driver located at: http://dev.mysql.com/downloads/
BIRT Sample Database
 Install the JDBC driver using the instructions on the
install page. Enter the following for the URL template:
 Introduction
 Schema jdbc:mysql://[host][,failoverhost...][:port]/[database]…
 Install
 Usage You are now ready to create the Classic Models database:

Introduction  Download the zip file containing the MySQL database


scripts.
The BIRT sample database provides a simple set of tables and  Expand the zip file into a convenient location.
data that form the basis for BIRT sample reports. The schema is for  Expanding the zip file created the
Classic Models, a retailer of scale models of classic cars. The ClassicModels/mysql directory with some MySQL
database contains typical business data such as customers, orders, scripts. From the command line, move to the this
order line items, products and so on. It was designed to illustrate directory:
many of the features of the BIRT report designer.

% cd /ClassicModels/mysql
The sample database is open source; you are free to use it for your
own use to experiment with other tools; to create samples for other
tools, etc. The sample database is provided under the terms  Start the mysql utility, giving the name (and password,
Eclipse.org Software User Agreement. if needed) of a user permission to create databases.
For example, to use the default root user:
Schema
% mysql --user=root
The database consists of eight tables:
 Create the ClassicModels database and load the
 Offices: sales offices schema. (Loading the schema the schema the first
time will give error messages as it attemps to empty
 Employees: All employees, including sales reps who work any existing tables, just ignore these.)
with customers.
 Customers
mysql> create database ClassicModels; mysql> use
 Orders: Orders placed by customers ClassicModels; mysql> source
 Order Details: Line items within an order. create_classicmodels.sql;
Date: 12/21/2017 Page: 12 - 17
 Load the table contents: and line graphs, JavaScript for dynamic images, style usage,
highlighting, grouping and detail drill down..
mysql> source load_classicmodels.sql;
Examples
 Exit from mysql:
 Solution Reports – This section contains several
example solution reports, such as Business Forms.
mysql> quit;
 Reporting Feature Examples – This section
demonstrates features and functions of the BIRT
Localized Version of the Sample Database Report Designer.
 Scripting – This section contains examples of
Following is the Derby Database localized into French, German, scripting within the BIRT Designer
Spanish, Japanese, Korean, and Simplified Chinese.  Integrating BIRT – This section demonstrates several
examples of deploying and using the APIs of BIRT
 Localized Derby Sample Database  Extending BIRT – This section covers extending the
feature set of BIRT, such as Open Data Access
Usage (ODA), Report Items, etc

You can now use the sample database within BIRT to create BIRT Solution Reports
reports. The key information you need to get started is how to
create a data source for the database. The details vary depending  Introduction
on the database system you selected.  Listing
 Business Forms
Apache Derby
Introduction
The Apache Derby version of the database is included in the BIRT
download as a built-in data source. To access it, simply select the
The example reports here show just a few of the things you
"Classic Models Inc. Sample Database" entry in the new data
can do with BIRT. Unless otherwise noted, the reports are
source dialog.
meant to be run against the "Classic Models Inc." sample
database that is included in the BIRT download.
MySQL
Preview a report by clicking on the title link. To try a report for
Data source properties for the MySQL sample database: yourself, click on the rptdesign link to display the ROM file,
save it to disk and then use File-->Import to bring the file into
Driver Class: com.mysql.jdbc.Driver your Eclipse workspace. If the report uses the Classic Models
URL: jdbc:mysql://localhost/classicmodels database, you should be able to run the report immediately. If
the report uses another database, follow the instructions
User Name: root
provided in the "Other Notes" section of its description.
Password:
Listing

BIRT Examples  Product Catalog (rptdesign)


Prints the Classic Models product catalog, grouped by
product category. Provides product name, cost and
 Introduction description. Demonstrates one level grouping and
 BIRT Demo using a grid within a table row to structure spacing.
 Examples Also shows image inclusion and use of the <value-of>
tag in text item to include the content of a database
column. Finally, the report makes use of styles to
Introduction
simplify maintenance and achieve a consistent look.
 Top Selling Products (rptdesign)
Weclome to the examples section of the BIRT site. Displays a pie chart showing revenue by product line.
Here you will find examples that illustrate some of the features of Lists the top selling products, sorted by revenue.
BIRT. This section will be changed frequently to add new examples. Demonstrates use of a chart and sorting a result set.
The example types are classified below. Feel free to make Also shows image inclusion and use of grid and
comments within the news group. Let us know what examples you tables to organize report content. Finally, the report
would like to see. makes use of styles to simplify maintenance and
achieve a consistent look.
BIRT Demo  Top N / Top M% Customers (rptdesign)
Making use of the top n and top precent filter
BIRT Demo – This demonstration is a Flash presentation of BIRT capabilities added in BIRT 2.0, this report shows a bar
that showcases some of its powerful features including summary chart with the top N customers by revenue, followed
by a listing of the top M% customers by revenue
Date: 12/21/2017 Page: 13 - 17
sorted by customer name. This requires multiple passes  Drill to Details – Example used to demonstrate linking
over the data, but it is all done "under the covers" by the a Master report to a Detail report.
BIRT report engine. N and M are passed into the report as  Report Elements – This example demonstrates using
parameters to allow report users to select the number and Label, Text, Dynamic Text, Data, and Image Report
percentage at run time. elements.
 Annual Sales By Product Lines (rptdesign)  Sub Reports – This example demonstrates building
This example illustrates building a static crosstab report sub reports using nested tables.
using the BIRT Total function. The report presents annual
 Mapping and Sorting – This example demonstrates
sales revenue by quarter for each of the product lines that
using the Mapping and Sorting features of BIRT.
Classic Models Inc currently sales. In addition totals are
aggregated across horizontal and vertical dimensions. The  Parallel Report – This example demonstrates how to
BIRT Total function can accept a second parameter that build a report with parallel sections.
filters the aggregate data. In this example this feature is  Highlighting and Conditional Formatting – This
used to only display values that pertain to a product example demonstrates how to add highlighting and
offering, such as Trains. The first parameter in the Total conditional formatting to a BIRT report.
function is the value to aggregate, and in this example it is  Grouping – This example demonstrates building a
set to quantity sold multiplied by price each. The second grouped report in BIRT.
parameter is the filter. So if the filter where specified as
dataSetRow["Products::PRODUCTLINE"]=="Motorcycles",
only the Motorcycles product line would be aggregated.

Business Forms
BIRT Integration

 Sales Invoice (rptdesign)


 Integration Points
Prints an invoice for the selected order, including customer
and invoice details and products ordered. Demonstrates  Runtime Integration
use of a parameter to select the order to invoice and  Design-Time Integration
expressions for several calculated fields, including  Extending BIRT
discount and order total. Uses expression to build  Report Viewer
customer address string and illustrates suppression of  Report Engine API
nulls in database fields with javascript function replace.
Also shows image inclusion and sophisticated use of grids
 Design Engine API
and tables to organize report content. Finally, the report
makes use of styles to simplify maintenance and achieve Integration Points
a consistent look.
BIRT reporting provides a variety of integration points to
accomplish various tasks:

BIRT Example Reports  Runtime integration


 Design-time integration
 Introduction  Extensions to BIRT

Introduction BIRT charting APIs are described elsewhere. (Not yet


available.)
This section of Examples focuses on the feature set within BIRT.
Simple reports are used to illustrate a function within BIRT. Most Runtime Integration
examples will have a before and after report that can be
downloaded. In addition, the example is illustrated in a Flash Your application can integrate the BIRT web and engine
presentation. runtimes:

BIRT 2.1 Examples  BIRT Report Web App


A series of URLs that your application can use to
 XML Data Source – This example demonstrates creating a display a parameter page, run and display a report,
report using the XML Datasource. etc.
 Libraries – This example demonstrates creating and using  Report Engine API
BIRT libraries. A Java interface used to embed the BIRT report
 Combination Chart – This example demonstrates building engine within your application. The engine behavior
a Combinatio Chart with Drill to details. can be customized for use in a web app, RCP app,
 Cascaded Parameter Report – This example command line app, etc.
demonstrates building a BIRT Report that uses a
cascaded parameter. Design-Time Integration
 Query Modification – An example of modifying the query
using Property Binding or Script.
Date: 12/21/2017 Page: 14 - 17
Your application can explore or create BIRT XML report designs:  Using the Viewer from PHP discusses how to run
BIRT reports from a non-Java scripting environment
 Design Engine API such as PHP. Also briefly summarizes how to use
Provides access to a BIRT report design. You can explore PHP to generate custom report designs.
the design, modify it and so on. Use this API to create your  Viewer Pages discusses the JSP that make up the
own custom report designer, or to perform batch tasks on viewer. (Not yet available.)
designs.  The viewer code is available in the BIRT CVS
 Generate a Report Design Directly repository in the org.eclipse.birt.report.viewer project.
If you can write XML files, or with templates, you can See the BIRT build instructions for information on how
generate report designs based on an application-specific to access CVS and build the viewer.
report designer. This technique is ideal for non-Java
scripting environments such as PHP. Report Engine API

Extending BIRT Use the Report Engine API to run BIRT reports directly from
Java code or to create a custom web application front end for
Your application can extend BIRT for your specific needs: BIRT.

 Scripting (Reference) (Scripting Primer)  Using the Engine API explains how to use the Engine
BIRT provides extensive scripting support. You can create API to create a simple command-line program that
anything from computed columns to sophisticated runs reports.
business logic to extensive integration with existing Java
code. Design Engine API
 Open Data Access (ODA) Extension API
BIRT provides a JDBC data source. Use the ODA API to Use the Design Engine API (DE API) to create a custom report
create custom data sources drivers. Each driver has run- designer tool, or to explore or modify BIRT report designs. The
time behavior along with optional design-time UI. BIRT Designer is built using this API. (Internally, the Design
 Scripted Data Source (Scripting Primer) Engine is also called the "report model" or just "model.")
The scripted data source and data set elements allow you
to access custom data sources directly from your report
without the need to create an ODA driver. This solution is  Using the Design Engine API: a brief primer for using
ideal for one-off data sources, prototypes, and the like. the DE API.
 Report Item Extension API  The Design Engine code is available in the BIRT CVS
The BIRT model is extensible; you can add new report repository in the org.eclipse.birt.report.model project.
items. Use this API to include design-time, run-time or See the BIRT build instructions for information on how
presentation-time behavior. to access CVS and build the code.

Report Viewer

The BIRT Viewer can be used in a variety of ways: Pre-Requisites and Installation Instructions for BIRT

 As a stand-alone, pre-built web application for running and  Introduction


viewing reports.  Report Designer Full Eclipse Install
 As a starter web application that you can customize to  Designer Install
your needs.  GEF
 As an example for learning how to build your own  EMF
reporting web application, or to learn how to use the BIRT  DTP
engine.  BIRT
 As a way to run a report using a URL. This option provides  Optional Eclipse Link File
a simple way to integrate BIRT reporting into applications
build using non-Java technology such as Perl, PHP or  iText
even static web pages.  prototype.js
 JDBC Drivers
The BIRT viewer is a web application included with BIRT to perform  Updating a BIRT Installation
the report preview operation within Eclipse. It is also a sample of  Deploying to J2EE Server
how to integrate birt with a web application.  Installing BIRT Language Packs on Windows
 Common Problems
 Integrating the BIRT Viewer explains how to deploy the
BIRT viewer onto your own application server. The Introduction
explanation uses Apache Jakarta Tomcat as the sample
deployment target.
Below are complete instructions for installing BIRT. If you are
 Using the BIRT Viewer discusses the viewer operation already familiar with Eclipse plugins, you might want to follow
URLs and their parameters. the abbreviated requirements and instructions on the download
Date: 12/21/2017 Page: 15 - 17
page. Otherwise, follow along below for detailed steps for installing  From the desktop, right click, choose New→Shortcut.
BIRT.  For location, enter "C:\Program
Files\eclipse\eclipse.exe" (without quotes.)
The instructions here are for the Release 2.1/2.0.2 (and later)  Click Next.
builds.  Enter “Eclipse” for the shortcut name.

Java GEF

You'll need a Java runntime environment (JRE) The version you GEF, the Graphic Editor Framework, is an Eclipse plugin used
choose will depend on the version of Eclipse you are running. See by the BIRT UI. Download the GEF 3.1/3.2/3.3 Release, GEF
below. Runtime.

Eclipse GEF comes as a zip file. Unzip GEF into directory that contains
Eclipse. If you installed Eclipse into the standard location on
BIRT is currently tested with the following configurations: Windows, then unzip GEF into "C:\Program Files".

 BIRT 2.0.2 EMF


 Eclipse 3.1
 GEF 3.1. The BIRT charting feature uses EMF, the Eclipse Modeling
 EMF 2.1. Framework. Download the EMF & SDO RT version 2.1/2.2/2.3.
Look in the Latest Releases sections of the download page.
 JRE 1.4.2/JRE 1.5.

EMF also comes as a zip file. Unzip EMF into directory that
And
contains Eclipse. This is the same directory you used for GEF.
 BIRT 2.1/2.1.1
 Eclipse 3.2.
DTP
 GEF 3.2.
 EMF 2.2.
BIRT sources data for reports using the Data Tools Platform
 JRE 1.4.2/JRE 1.5. Project. Download DTP version 1.5. Note that 1.5 is only a
requirement for versions of BIRT newer than BIRT 2.2 M6. 2.2
And M6 is the last version of BIRT to include the required DTP
 BIRT 2.2M4 and higher plugins in the designer download.
 Eclipse 3.3.
 GEF 3.3. The BIRT allinone download will continue to include the
required DTP plugins. Additionally a separate download is now
 EMF 2.3.
available on the BIRT site that is a subset of the DTP plugins.
 JRE 1.5. This package referred to as the BIRT/DTP Integration package
 DTP 1.5. contains only the required DTP Plugins needed for BIRT to
function.
Report Designer Full Eclipse Install
BIRT
BIRT now supplies a download that incudes Eclipse, GEF, EMF and
BIRT. Use this download if you do not already have Eclipse Download Release 2.1.1 (or later). Download only the BIRT
installed. You will still need iText.jar and prototype.js (this file is no designer framework for now: "birt-report-framework-2_1_1.zip".
longer needed with 2.1 or later builds), which are described below.
BIRT is also a zip file. Unzip BIRT into the directory that
Designer Install contains Eclipse.

Use these instructions if you have Eclipse installed or do not desire Optional Eclipse Link File
to use the Report Designer Full Eclipse Install.
Download and install the Eclipse Platform 3.1/3.2/3.3 Release
If you currently have an Eclipse install with GEF and EMF, you
can download the BIRT framework and unzip the contents to
(Note: Eclipse, EMF, GEF, DTP and BIRT are all available from the any directory.
Eclipse download page.)
 After doing this, create a links directory in your
Eclipse comes as a zip file or tar file. On Windows, unzip the install installed Eclipse location (ie
file into your "C:\Program Files" directory. This will create a C:\eclipse3.2\eclipse\links).
subdirectory called eclipse.
 Within this directory create a file with a unique name
like birt.2.1.link.
To make it easier to start Eclipse on Windows, create a shortcut to  Open the file you just created and enter
Eclipse on your desktop: path=drive:/pathtobirt (ie path=c:/birt2.1)
Date: 12/21/2017 Page: 16 - 17
 You will still need iText and prototype.js files. See next  Locate your Eclipse plugins directory. If you installed
section. on Windows in the default location, this is "C:\program
files\eclipse\plugins".
iText  Delete all directories that start with "org.eclipse.birt".
 Download and install BIRT as described in the BIRT
section above.
 iText 1.3.
 Restart Eclipse with the -clean option: eclipse -clean
The iText APIs are discussed at iText Homepage
Deploying to J2EE Server
If you are installing BIRT 2.2 M2 or later, download version 1.4.6 of
iText instead of 1.3. Please see Setting up the BIRT Viewer

BIRT 2.0.2 Birt 2.0.2 Runtime Note:


The itext-1.3.jar file needs to be copied to the
plugins/org.eclipse.birt.report.engine.emitter.pdf_version/lib  If you are installing the BIRT 2.0.2 Runtime (J2EE
directory. Application Server Deployment), The iText and
BIRT 2.1.0 (or later) prototype files will need to be copied to the birt-
The itext-1.3.jar file needs to be copied to the runtime/Web Viewer Example directory structure.
plugins/com.lowagie.itext_*/lib directory.  Copy itext-1.3.jar to /Web Viewer
Example/plugins/org.eclipse.birt.report.engine.emitter.
pdf/lib.
Birt 2.1.1 or Later Note:
 Copy prototype.js v1.4.0 to /Web Viewer
To Support Asian fonts in PDF, download the following jar Example/ajax/lib.
and place it in the plugins/com.lowagie.itext_*/lib directory.
 iTextAsian.jar.

Birt 2.2 M2 or Later Note: Birt 2.1 Runtime Note:


The iText version has been updated, download the
 If you are installing the BIRT 2.1 Runtime (J2EE
following jar and place it in the
Application Server Deployment), The iText file will
plugins/com.lowagie.itext_*/lib directory.
need to be copied to the birt-
 iText 1.4.6. runtime/WebViewerExample directory structure.
 Copy itext-1.3.jar to /WebViewerExample/WEB-
INF/platform/plugins/com.lowagie.itext/lib.

prototype.js

This step is only required if installing BIRT 2.0.2 or earlier. Birt 2.1.1 Runtime Note:
Download prototype.js v1.4.0 from dev.conio.net. Copy it into the  If you are installing the BIRT 2.1.1. or 2.1.2 Runtime
plugins/org.eclipse.birt.report.viewer_version/birt/ajax/lib directory.
(J2EE Application Server Deployment),
 Copy itext-1.3.jar to /WebViewerExample/WEB-
INF/platform/plugins/com.lowagie.itext/lib.
JDBC Drivers
 Copy iTextAsian.jar to /WebViewerExample/WEB-
INF/platform/plugins/com.lowagie.itext/lib.
You will likely want to use your own JDBC driver with BIRT. Use the
data source editor’s JDBC driver management wizard. To start the
wizard, open a BIRT report design, go to the Data Explorer view,
right click on “Data Sources” and select “New Data Source”.
Choose “JDBC Data Source” and click “Next”. In the next dialog, Birt 2.2M2 Runtime Note:
choose “Manage Drivers…” to bring up the “Manage JDBC Drivers”  If you are installing the BIRT 2.2M2 or later Runtime
dialog. (J2EE Application Server Deployment),
 Copy itext-1.4.6.jar to /WebViewerExample/WEB-
In the “JAR Files” tab, click on “Add…” to add the JAR file required INF/platform/plugins/com.lowagie.itext/lib.
by your JDBC driver. Then go to the “Driver” tab to confirm that the  Copy iTextAsian.jar to /WebViewerExample/WEB-
list of drivers includes the new drivers added. You may also want to INF/platform/plugins/com.lowagie.itext/lib.
assign a display name and URL template for the new drivers in this
tab.

Updating a BIRT Installation


Installing BIRT Language Packs on Windows

If you have a version of BIRT installed, and want to install a newer


1. Download the Language Pack for the desired product
version, do the following:
and extract into your eclipse install.
2. Open the Regional and Language Options in the
 Close Eclipse. Control Panel and switch to the advanced tab.
Date: 12/21/2017 Page: 17 - 17
3. Select the group 1 language you desire from the drop-
down combo box.
4. Save changes and restart the system.
5. Launch Eclipse and select Window->Preferences-
>Report Design->Preview. Select the desired language
from the drop-down combo box.
6. Restart Eclipse.

Common Problems

Some problems are due to cached information within Eclipse.


Eclipse caches information about plugins for faster startup. Adding
BIRT as we did above may result in stale cached information.
Symptoms of this problem include:

 The BIRT perspective does not appear in Eclipse.


 You receive "An error occurred" dialogs when opening
reports or using the BIRT UI.

Cleaning Cached Plugin Information

The solution is to clean up the cached information. The


recommended practice is to start Eclipse with the -clean option:

eclipse -clean

Cleaning the Cache on Windows

If you are on Windows, and are not familiar with how to invoke
Eclipse from the command line, do the following:

 Choose Start→All Programs→Accessories→Command


Prompt
 Move to the directory where you installed eclipse. If you
installed Eclipse in the standard location, enter:
 cd "\Program Files\eclipse"
 Run Eclipse with the -clean option:
 eclipse -clean
 Eclipse will restart. Again check for the BIRT perspective.

Anda mungkin juga menyukai