Using Sub Reports in SmartDoc


Ambox warning pn.png This feature is deprecated and should no longer be used, but may still be available for reasons of backwards compatibility.

You can use a report/sub report combination to report on two sets of information, and create a document based on the main report data, as well as the subordinate data in the sub report.

For instance, you may wish to create a document that contains details of a contact and all the associated contact activities, or perhaps the details of a company and all the contacts at that company.

These types of documents require that you create a report/sub report combination report within SmartSimple. You should refer to the reporting documentation from SmartSimple that describes how to create these reports.

There are three methods available to include a sub report into a document.

Contents

Insert Each Sub Report Field into a Table

This is the simplest technique. To use this technique, add the standard Doc Variables for the fields you wish to reference from the main report (as in the previous example), and a single bookmark to the first cell of the table.

This bookmark is created with the same name as the sub report and when the report is run, SmartDoc will add all the information sequentially into each cell from the sub report and add new table rows as required.

For instance, if the sub report was indicated during setup as having a key of 0, then the bookmark would be named SubReport_0

In this example, the same document shown previously can be used to display all the contacts for the selected company.

Smartd23.png

A table has been added to the document, and a bookmark named subreport_0 added to the first cell of the second row in the table.

The sub report will insert the first firstname value, then the first lastname value, the phone, and the email address values.

An additional row will be added to the table for each record in the sub report.

The completed document would look as follows:

Smartd24.png

Control the Location of Each Sub Report Field

If you wish to control the position of a single set of values from a sub report field, rather than simply position it in a table, you can use Doc variables to reference columns in the sub report.

Example 1

Display the value of column 2 where column 1 contains the value “John” from sub report 0.

Smartd25.png

Example 2

Display the value of column 1 where you are prompted to choose the record to use – all records will be displayed - from sub report 0. When you choose the record, only the contents of column1 will be displayed.

Smart26.png

Note: a wildcard “*” can be used in the criteria.

Example 3

Similar to the previous example but multiple fields are displayed (column 1,2,3). These Doc variables can be placed anywhere in the document and do not need to be grouped together.

Smartd27.png

Note: you can only prompt once for a sub report.

For additional information or examples contact the SmartSimple help desk, or add your questions to the SmartSimple Knowledgebase.