| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 transitional//EN"> | |
| <html> | |
| <head> | |
| <title>BIRT Tutorial</title> | |
| <link rel="stylesheet" href="../style/compose.css" type="text/css"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
| </head> | |
| <body> | |
| <p class="head">BIRT Tutorial</p> | |
| <p class="subhead">Using a Text Item</p> | |
| <h1>About Text Items</h1> | |
| <p> | |
| The final step in our report is to create the actual header text. We want it | |
| to look something like this: | |
| <p> | |
| <center><font size="4" color=blue>Customer Listing</font> | |
| <br> | |
| <i>For internal use only</i></center> | |
| <p> | |
| We could build this up with two labels. But, we'll take this opportunity to | |
| try out the Text element which allows us to use HTML formatting directly | |
| within the text. | |
| <h1>Create a Text Item</h1> | |
| <p> | |
| Let's create our text item. | |
| <ul> | |
| <li>Drag a Text item from the palette and drop it into the center cell within | |
| our grid. | |
| <li>The Edit Text Item dialog appears. | |
| <li>In the top combo box, choose HTML/Dynamic Text. The dialog displays a | |
| variety of HTML tags we can insert.<li>Using the button next to Formatting, pull down the list and choose | |
| Layout. | |
| <li>Click the <CENTER> tag to add it. | |
| <li>From the list near the top of the dialog, insert a <FONT> element.<li> | |
| In the attributes provided, set the size to 6 and the color to blue. Erase the | |
| face attribute. The text | |
| should now look like this: | |
| <pre class="code-block"><CENTER> | |
| <FONT size="6" color=blue> | |
| </FONT> | |
| </CENTER></pre> | |
| </li> | |
| <li>Continue adding elements and typing to create the finished HTML: | |
| <pre class="code-block"><CENTER> | |
| <FONT size="6" color=blue> | |
| Customer Listing | |
| </FONT> | |
| <BR> | |
| <I>For internal use only</I> | |
| </CENTER></pre> | |
| <li>Click OK to save your changes. | |
| </ul> | |
| <div class="caution"><span class="caution-head">Release 1.0 Note:</span> | |
| The layout editor displays the actual HTML. Later releases | |
| may show the formatted text.</div> | |
| <h1>Dynamic Text</h1> | |
| <p> | |
| While we won't use it in this tutorial, there is one other feature of text items | |
| to note. Select the Dynamic Text category and you'll see a <value-of> tag. | |
| This allows you to insert expressions directly into your HTML. For example, | |
| to display an address line in US format, we could say: | |
| <pre class="code-block"><value-of>row.city</value-of>, | |
| <value-of>row.state</value-of> | |
| <value-of format="@@@@@-@@@@">row.zip<value-of> | |
| </pre> | |
| <p> | |
| The contents of the <value-of> tag can be any expression. Indeed, it can be | |
| any JavaScript code. The optional format attribute lets you use any of BIRT's | |
| format strings to format the data. | |
| <h1>Final Test</h1> | |
| <p> | |
| We're now ready to give the report a final test. Click the Preview tab to see | |
| the report with formatting applied. | |
| <p> | |
| </body> | |
| </html> |