Home > Articles

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

About report files and supported formats

In the tutorial, you created and formatted a report using graphical tools. This section describes the document model that BIRT Report Designer uses and how you can view the code behind the report. This section also describes how to save and preview a report in formats other than HTML.

Report design files

BIRT Report Designer uses a simple document model. When you create and save a report design, BIRT Report Designer creates just one file with the .rptdesign file-name extension. This file contains all the information that is necessary for generating a report.

Unlike many report design tools that generate files in proprietary formats, BIRT design files are written in XML. XML is a widely used markup language specification that was designed especially for web documents. Because BIRT uses XML to define the structure and contents of a report design, developers can leverage their knowledge of XML to get a deeper understanding of how BIRT constructs a report design. BIRT's suite of report-specific XML elements and properties is called Report Object Model (ROM).

You open a report design (.rptdesign) file with the report editor, which, by default, displays the report design in the layout editor. The layout editor provides a graphical view of the report design. If you wish, you can view the report design in the XML editor. This editor displays the XML that BIRT Report Designer generates when you create a report.

View the report design in the XML editor to see its XML code or to locate, by line number, an error that was reported in the Problems view. To understand the XML code, you can consult the ROM specification at the following location:

http://www.eclipse.org/birt/phoenix/ref/

How to open a report design

  • If using BIRT Report Designer, use one of the following methods:

    • In Navigator, double-click the .rptdesign file.
    • Choose File rarrd.jpg Open File, then select the .rptdesign file from the file system.

    If someone sends you a .rptdesign file, first save the file in a project folder, then, in Navigator, right-click the project, and choose Refresh. This action updates the project folder to include the file, which you then open using one of these two methods.

  • If using BIRT RCP Report Designer, choose File rarrd.jpg Open File, then select the .rptdesign file from the file system.

Eclipse saves your environment settings when you exit. If you keep a file open when you exit Eclipse, this file opens when you next start Eclipse.

How to view a report design in the XML editor

  1. Open the report design file, using one of the procedures that is described in the previous section.

    The layout editor displays the graphical view of the report, as shown in Figure 3-39.

    Figure 3-39

    Figure 3-39 Report design in the layout editor

  2. Choose the XML Source tab at the bottom of the report editor.

    The XML editor displays the XML that defines the report design, as shown in Figure 3-40.

    Figure 3-40

    Figure 3-40 XML code for a report design

Report output formats

You can save and view a report in the following formats:

  • HTML
  • Microsoft Excel document (.xls)
  • Microsoft PowerPoint document (.ppt)
  • Microsoft Word document (.doc)
  • PDF
  • Postscript

In addition, users who receive reports can export the data to any of these common office software formats, then edit and redistribute the reports to other users.

Previewing a report

As you work on the design of a report, you typically want to see the report as it would appear to the report user. Using BIRT, you can easily preview a report in any of the supported output formats. You can also view the report in the BIRT report viewer. The report viewer, shown in Figure 3-41, is an interactive viewer that provides report users with the capability to jump to specific pages or to specific sections of a report, to run a report to get the latest data, to print a report, and to export a report to any of the supported output formats.

Figure 3-41

Figure 3-41 BIRT Report Viewer

The following list describes the ways to preview a report:

  • To preview a report in BIRT Report Designer, choose the Preview tab at the bottom of the layout editor. The previewer displays the report in HTML format.
  • To preview a report in the report viewer, choose Run rarrd.jpg View Report rarrd.jpg In Web Viewer.
  • To preview a report as a Microsoft Word document, choose Run rarrd.jpg View Report rarrd.jpgAs DOC.
  • To preview a report in HTML format in a separate window, choose Run rarrd.jpgView Report rarrd.jpgAs HTML.
  • To preview a report in PDF format, choose Run rarrd.jpg View Report rarrd.jpgAs PDF.
  • To save a report as a PostScript file, choose Run rarrd.jpg View Report rarrd.jpgAs POSTSCRIPT.
  • To preview a report as a Microsoft PowerPoint document, choose Run rarrd.jpg View Report rarrd.jpg As PPT.
  • To preview a report as a Microsoft Excel document, choose Run rarrd.jpg View Report rarrd.jpgAs XLS.
  • + Share This
  • 🔖 Save To Your Account