Main Content

Use Subforms in Reports

A document part is a form that you can add to a document or to another document part. Document parts simplify generating sections of a report that have the same form, such as sections that report on the results of a series of tests or the performance of a series of financial portfolios. Use a similar approach as you do for main document forms.

  1. Create a template that defines the form of the document part.

  2. For each section:

    1. Create an mlreportgen.dom.DocumentPart object.

    2. Fill in the holes.

    3. Append the part to the main document.

For an example of a report that uses subforms, open the Functional Report example.

Tip

The DOM API allows you to store the templates for document parts in the main template for a report. This capability allows you to use a single template file to supply all the templates required for a report. For details, see Create Microsoft Word Document Part Template Library.

See Also

Functions

Classes

Related Examples

More About