InetSoft Product How-To: Embedding Subreports in Reports

A subreport is a report embedded inside another report. A subreport can only be embedded within a section element.

Headings/Table Of Contents

This section explains how to add headings and automatically generate a Table Of Contents (TOC).

Adding Headings

Heading elements are a special kind of text element. A heading element has an additional heading level attribute. The heading level has two effects on the element. First, a heading number is automatically generated and optionally printed to the left of the text. Second, the heading elements are also used to create a Table Of Contents (TOC) if a TOC element exists in the report.

To add heading elements to the template, follow these steps:

  1. Place the cursor at the location that you wish to add the new heading.
  2. Click the ‘Heading’ button, and select the heading level from the drop-down list. This inserts a new Heading element at the cursor location. (The heading level can be changed later.)
  3. Enter the desired heading text into the text field. (See the Text Element section for details about text elements.)
  4. Right-click the heading element, and select ‘Properties’ from the context menu. This opens the ‘Heading Properties’ dialog box.
  5. Select the Heading tab in the ‘Heading Properties’ dialog box.
  6. Enter the ‘Level’ of the heading, and select a heading ‘Format’. The dot-separated formats, such as “1.2.3.4.5.6.7.8” and “a.b.c.d.e.f.g.h,” indicate that the number or letter of the selected heading will be prefixed with the numbers/letters of its superordinate headings. The single-character formats, such as “8” or “h,” indicate that the number of the selected heading will be displayed without any prefixed digits. To define a custom heading format, select the ‘Custom’ option, and specify a class that implements the inetsoft.report.HeadingFormat class.
  7. Select ‘Show Number’ to display the heading number to the left of the heading text (default).
  8. Select ‘Show Page Number’ to display the heading page number in a generated TOC (default).

Effective dashboards example



Effective dashboards example

Soap Example

Painter

To add a painter, click the ‘Painter’ icon. This opens the ‘Painter Properties’ dialog, which is used to set the attributes described above, such as the anchor, text wrapping and margin for the painter. The painter appears as a gray box area on the report, which is where the actual painter will be drawn. The painter object needs to be associated with the template element programmatically.


Image

The image element is commonly used to decorate a page (e.g., adding a corporate logo or fancy report header). Adding an Image Element To add an image to a report, follow the steps below:

  1. Click the image button on the left toolbar. This opens ‘Image Properties’ dialog box.
  2. Deselect the ‘(none)’ option, and enter the image location. See Specifying the Image Location below.
  3. Select ‘Embed Image’ to embed the image data in the report template as an XML object (convenient for smaller images).

Stack of Reports