![]() |
|||
|
|||
Creating a Sub Report Display ObjectOverviewExisting 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.
Creating a Sub Report Source DocumentAny 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.
The output when run as a standalone report would look similar to what is shown below:
Adding a Sub Report ObjectTo add a sub report display component click the add display object icon 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: 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. The sub report object will appear in the design pane with a thick, black border. Example Sub Report OutputOne 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: 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. In example output below "Allow Overflow" is checked - now sub report results are allowed to overflow the component border. |
|||
|