View Report: Tutorial_1-Building-a-Simple-Listing-Report
Download Report: Tutorial 1: Create Simple Listing Report (172 downloads)
We’re almost done with Tutorial 1. We’ve covered most of the fundamentals of Building a Simple Listing Report.
In this lesson, we have one last important task to do and that’s to give our report a title.
If you review the matrix, you can see that different report elements have advantages and disadvantages as report titles. I find that I tend to use “Text” and “Data” elements mostly for Titles to BIRT Reports. I like “Labels” as column headers because I can create dynamic sorts with them. “Labels” also make great links for drill-downs to other reports. But “Labels” are static and don’t allow you to add any dynamic values like dates or user inputs to them. On the other hand, “Data” and “Text” elements can handle dynamic elements like dates and user inputs, making them good as Report Titles.
In this lesson, we are going to be using a “Text” element and HTML tags to format the text.
For the first step, use the mouse to drag & drop a “Text” element from the Palette to the Layout Editor.
In order to place the “Text” element above our Table, we actually need to drop the “Text” element to the left of the Table. You should actually see a long black sliver (shown in the figure above) to the left of the Table when the cursor is in the proper position to release the “Text” element. That may seem odd at first. But, once you get used to the interface, placing Report Elements into the Layout Editor like this will become second nature to you.
Be careful placing the “Text” element because it’s easy to accidentally drop it into the table. If you do make a mistake, just drag the “Text” element from inside the Table and drop it outside the Table where it needs to go.
For starters, you need to click on the drop-down menu that displays “Auto” by default. The options to choose are “HTML” and “Plain”.
For this tutorial, select “HTML” from the drop-down menu. In my experience, I use this option pretty much every time. I haven’t had a call to use “Plain” text over “HTML” because all the reports I have done tend to be designed for the internet. Also I have noticed that leaving a “Text” element set to “Auto” causes problems when the report displays online.
With “HTML” selected, BIRT will allow you to embed HTML tags and CSS properties in the “Text” item.
There are HTML “Formatting” tags displayed by default.
To check out more available HTML Tags, click the other drop-down menu in the window that is on the top left edge of the Text area.
Putting the HTML tags into the Text area below is done by giving the tag a single click. When you do, both the opening and closing tag are added.
As a reference, here’s a matrix that shows all the BIRT “Text” element HTML Tags:
HTML tag types include: “Formatting”, “Layout”, “Content”, “Lists”, and “Dynamic Text”. Over time, you probably will find the need to use all of these tags for your text.
Next, copy and paste the block of the following block of HTML code here into the text area:
You can also copy this same code from the Help Contents of your Eclipse IDE for BIRT that this tutorial follows.
Since learning how to use HTML is beyond the scope of this lesson, we’re not going to go through and build our own code here.
But, if you are feeling adventurous, you can adjust the HTML code here to see how it changes the look of the title. But, if you are new to all of this, I suggest you stick with the code provided here until you have successfully completed the lesson. You can always come back later and re-visit this code if you want to experiment with it.
Once you have pasted the code into the text area, click OK to close out the window and go back to the Layout Editor.
Look at the Title for your report.
In the Title, you should see 3 lines of text from the new “Text” element. Note that each line is using a different font-size and that there is a dynamic value for the Date Timestamp. If you refresh the report, the Date Timestamp value adjusts to reflect the latest run time of the Report.
This versatility in the display makes the “Text” element a great choice as a Title of a Report.
If you were trying to do this without a “Text” element, you would have needed 2 Labels to cover “Customer List” and “For Internal use only”. And you also would have needed a “Data” element to include the dynamic Date Timestamp.
Either way works. But the “Text” element lets you create the title more efficiently.
At this point, you’ve completed the task of Creating a Report Title and the lesson on How to Build a Simple Listing Report.