Home > Designer Download RBT v1.3.1

Creating a Sub Report Display Object

Overview

Existing documents can be added to document design as sub report display components. In order for an existing document to function as a sub report, the source document must be configured to require runtime input parameters and the parent document must contain columns of the same type as these runtime parameters. When the sub report is added to a parent document, the designer will map parent document columns to runtime input parameter columns.

There are several things to consider when using sub reports.

  • Each sub report is fully functional document running a predefined database query - this can significantly impact document performance especially when multiple sub reports are added to the parent document.
  • The number of rows returned by a sub report are not known until runtime.
  • Two types of display modes are available for a sub report - overflow and non-overflow. In non-overflow mode, result data will be limited to the component box - any overflow will be hidden. In overflow mode all result data will display and will flow with the normal document page configuration.
  • Only one sub report on a document can be set to overflow mode and it is required to be in the body section.
  • When run as a sub report there will be slight differences in the document layout as compared to when it is run standalone.
  • Sub reports are only allowed to be one level deep - sub reports cannot contain sub reports.

Creating a Sub Report Source Document

Any RBT document that is configured to require runtime input parameters can be used as a sub report. That said, there are some considerations to keep in mind. You will want to ensure that page margins, headers and footers fit into the layout you design for the parent report. You should also be aware of the potential number of rows returned by the sub report - ideally this number will be low. Lets take a look at an example design.

The example below is a simple report that selects employee information by department. You can see that we have defined a runtime input parameter - the ? - for the EMPLOYEES.DEPARTMENT_ID in the filter pane. In the design pane you can see that page margins and header have been minimized.

subreport source select pane

subreport source filter pane

subreport source design pane

The output when run as a standalone report would look similar to what is shown below:

subreport source output

Adding a Sub Report Object

To add a sub report display component click the add display object icon add display object to display the Add Design Object pane. Select Sub Report and the desired destination then click ok to display the Select Sub Report pane.

add design object

select sub report

In the Select Sub Report pane you will choose the source document for you sub report. Enter a name that will display in the designer. Check/uncheck the Allow Overflow (if enabled) as per the discussion in the overview section. Select the desired document from the document select tree and map the sub report columns to the parent document columns. If you choose a sub report document with no available columns you will receive an error message similar to what is shown below:

select sub report

Once a valid document has been selected, the column mapping list will populate and you can assign parent document (source) to sub report (destination) column mappings.

select sub report

The sub report object will appear in the design pane with a thick, black border.

sub report in design pane

Example Sub Report Output

One important aspect of the sub report setup is the Allow Overflow setting. To review, there are two types of display modes available for a sub report - overflow and non-overflow. In non-overflow mode, result data will be limited to the component box - any overflow will be hidden. In overflow mode all result data will display and will flow with the normal document page configuration. Only one sub report on a document can be set to overflow mode and it is required to be in the body section.

In the examples that follow we will use the layout shown in the design pane below where the "department employees" object is a sub report:

select sub report

The example output shown below is with "Allow Overflow" unchecked. As you can see, all sub report results remain inside the border defined by the display component.

select sub report

In example output below "Allow Overflow" is checked - now sub report results are allowed to overflow the component border.

select sub report