Creating Birt Templates

Today I'll briefly go over Templating Reports in Birt, a feature I didnt know about for over two years but have realised it is a hugely benificial tool.

Why Should I Template?

Consistency across reports - both web based and printable documents is hugely important and creates an image of professionalism for both employees and clients. We can use templates to maintain this consistency. This saves us recreating the individual components each time ( which will often be ever so slightly different ! ) and wasting developer time and resources. Seems like a no-brainer right ?


We'll create a basic template with for printable documents like receipts including a header below, but you can create ones as complex as nessessary to suit your requirements.


Steps

  1. In Eclipse Click File -> Create New -> Template
  2. Set file name, click next. Enter the template display name and description. Click Finish.
  3. We'll create a header area that will appear on every printed page. Open the Masterpage Tab.
  4. Increase the header height, insert a Grid. On the left I insert the company logo via an embedded image. On the right are the company details.
  5. Back in Layout Tab add a text element. This will contain the text for the document type.
  6. To Export Click File -> Register Template with Report Wizard.
  7. Click Finish to Register the Template.
  8. Now when we create a new report the Print Template will be listed among the available templates.

Comments