View Report: Tutorial_1-Building-a-Simple-Listing-Report
Download Report: Tutorial 1: Create Simple Listing Report (184 downloads)
Laying out the Report is Task 5 of 8 for Building a Simple Listing Report in BIRT.
1). Iterates through all the data from our query,
2). and puts that data neatly into a Row and Column format.
The Table can have only one or more columns. You choose based on the reporting needs. The more columns in your Table, the wider your screen needs to be to display the Report. When you need to scroll left and right in your browser window to see all of the columns in your Table, you have reached the point where the report ceases to be a good data visualization tool. Likewise, if you have so many columns in the report that the data in the columns is unreadable because the table is too narrow to show the data, you have also reached the point where the report is going to be useless as a data visualization tool.
On that note, the quickest way to display data in a Table is to just drag & drop the Data Set from the Data Explorer into the Layout Editor. But, this method is also messy because it pulls over every field from the Data Set into its own column. If there are 50 fields, you’ll have 50 columns in the table – there’s almost no computer screen big enough to view this many columns in a clean report. It’s just plain ugly. If you need to make a Data Dump widely available to certain members of your organization, then this might be a good choice as a method to make a Table.
But, even in this beginner’s lesson, there are 4 fields in the Data Set, and the lesson only calls for us to make a Table with 3 columns. So we’re not going to drag & drop the Data Set into the Layout Editor to create a Table.
Instead let’s go to the “Palette” window.
You should see the Palette window on the left side of the Eclipse IDE. If you don’t, don’t panic. There’s a good chance that you are going to accidentally close out one of the important windows in the Eclipse IDE for BIRT during the course of working on reports every day. You should know how to get the Palette window or any other window back if that happens.
Go to “Window” in the Navigation menu above, then go to “Show View”. Note that there are several “Views” here that you can make visible in the Eclipse IDE for BIRT if you need them. Then just click on “Palette” and Eclipse will pop the Palette window back on to your screen.
A window opens called “Insert Table”. There a few parameters that you can control in this window. You want the “Number of columns” to equal 3. And you want the “Number of details” to equal 1. You may not need do anything here, because those parameters should be the defaults. For “Data Set” use the Drop Down menu to select “Customers”. Once you’re set, click OK.
Now you should have an empty Table in the Layout Editor. If you look closely at the 3 rows in your empty Table, you can see a “Header Row”, a “Detail Row”, and a “Footer Row”. You don’t want to place any of the data from the Data Set into the “Header Row” or the “Footer Row” because the report won’t lay out properly.
The “Detail Row” is the one you want because it repeats to display all the data rows from the Data Set.
When you take these fields and place them into the “Detail Row”, BIRT will automatically populate a “Label Element” directly above the “Data Element” in the Table. This “Label Element” becomes the Column Heading when you preview the report.
Now, place the field “CUSTOMERNAME” into the “Detail Row” of the Table. When you do that, the “[CUSTOMERNAME]” field goes into the Detail Row and a “Label Element” of “CUSTOMERNAME” goes directly above it in the “Header Row”. BIRT will copy whatever the field name is into the “Label Element” above it in the header.
In the same way, put the remaining fields from the Data Set into the Table.
The field for “PHONE” will go into the 2nd column.
The field for “CONTACTFIRSTNAME” will go into the 3rd column.
Finally, put the “CONTACTLASTNAME” into the 3rd column too. Place it directly below “[CONTACTFIRSTNAME]”. To do that you may have to practice a few times because the cursor needs to look like a long sliver directly below the field “[CONTACTFIRSTNAME]”. Also note that dropping a second Field into a column that already has a field does not change the “Header Row”. The “Header Row” still reads “CONTACTFIRSTNAME”.
Once you have successfully placed the fields into the table, click Preview.
You should also see that this report has some room for improvement. The report lists the data in no particular order, the headers are not user friendly, and it’s hard to read. But that’s something we’ll be tackling in the upcoming tasks in this tutorial.
At this point, you have successfully completed the task to Layout the Report.