Tin Tức

Helical IT Solutions Pvt Ltd

You are interested in Helical IT Solutions Pvt Ltd right? So let's go together natuts.com look forward to seeing this article right here!

This article provides a step-by-step guide on how to create a simple BIRT report using the BIRT report designer. We will also learn how to access data from a MySQL database. So, let’s dive in and get started!

Getting Started with BIRT Report Development

To begin with, you need to download the BIRT report designer. You can find it at here. There are various download options available, but I recommend choosing the “All-in-One” package as it includes all the necessary BIRT plugins preinstalled. After downloading, simply unzip the archive file and start the eclipse application.

Adding Required Drivers for Database Connection

If you want to add drivers for your database connections in the designer, copy the driver jars to the following folder in your eclipse installation:

<eclipse home>/plugins/org.eclipse.birt.report.data.oda.jdbc_X.X.X.vxxxxxxxxxxxx/drivers

For example, if you’re using MySQL, add the MySQL driver jar file.

Creating a Project

Once the report designer is set up, create a new project in eclipse using the “new project wizard”. You will notice a new category called “Business Intelligence and Reporting Tools” in the wizard selection list. Select the “Report Project” option under it.

Fig 1 new report project

Adding a BIRT Report to the Project

Now, add a new report file (rptdesign) to the project. Right-click on the project in the navigator window, click on “new à report”, and give an appropriate name to the file. This file will contain the report definition of the BIRT report. It’s an XML-based report design, a single “.rptdesign” file that contains everything required for the report to execute.

Fig 2 New report file

Designing the Report

When the “rptdesign” file is open, you will see four tabs in the main window. The first tab shows a canvas where you can drag and drop various items from the palette to design the report. The other tabs include the master page, scripts tab for adding custom scripts, and the XML source tab to view the source of the design file.

In the “Outline” window, you can see the entire list of items that will define your report. Let’s start adding components to our report.

Creating a Data Source

Right-click on the “Data Sources” in the Outline window and select “new Data Source” to open the wizard. It lists all the different types of data sources that can be created. For this tutorial, select the JDBC data source and fill in the required connection details to create the data source.

Fig 3 Data source properties

Creating a Data Set

A dataset is the query that fetches the data to be displayed in your report. You can associate a dataset with tables, charts, and other report elements.

To define your dataset, right-click on the “Data Sets” in the outline. The wizard allows you to select a dataset and then choose the “Data Set Type”. In our case, it will be a SQL query. Write your SQL query, and all the fields will show up under the dataset in the outline.

Fig 4 Query for Dataset

Adding a Table to the Report

Drag a “table” component from the palette and drop it on the canvas. It will ask for a dataset to associate with the table. Select the dataset we created earlier. The table will display all the fields from the dataset, and you can choose which ones to display. The table consists of three sections – Header, Detail, and Footer.

Fig 7 Table

Use the “properties window” to format the table’s appearance. You can add borders and change the font to make it visually appealing.

Fig 6 Properties Window

That’s it! You have successfully created a basic BIRT report. You can also change the page heading by navigating to the “Master Page” tab.

Fig 8 Master Page

Previewing the Report

There are various types of previews available. When you preview in the web viewer, the BIRT report viewer is used to render the report.

Fig 9 Birt Report Previews

With this, our simple BIRT report is complete! Stay tuned for more posts on BIRT reporting.

Shraddha Tambe | Helical IT Solutions


This article was based on the original content from helicaltech.com

Conclusion: So above is the Helical IT Solutions Pvt Ltd article. Hopefully with this article you can help you in life, always follow and read our good articles on the website: natuts.com

Related Articles

Back to top button