Main Content

Add Holes in HTML and PDF Templates

Template holes are places in a template that a report program fills with generated content, supporting a form-based report.

Types of Holes

You can create inline and block holes.

  • An inline hole is for document objects that you can append to a paragraph: Text, Image, LinkTarget, ExternalLink, InternalLink, CharEntity, and AutoNumber objects.

  • A block hole can contain a Paragraph, Table, OrderedList, UnorderedList, DocumentPart, and Group.

Create Holes

Use the same code to create a hole for inline and block holes. To create an inline hole, add the <hole> element to a paragraph. Create a block hole without a paragraph as its parent.

  1. Unzip the template using the unzipTemplate command.

  2. Open the root.html or docpart_templates.html file in an HTML or text editor.

  3. Add code in any of these forms:

    <hole id="HOLEID" default-style-name="STYLE_NAME">DESCRIPTION</hole>
    <hole id="HOLEID" default-style-name="STYLE_NAME" />
    <hole id="HOLEID" />

    • Replace HOLEID with the hole identifier. If you need to get a hole ID or refer to a hole by ID in your report program, use this ID.

    • Replace STYLE_NAME with the name of a default style to use for formatting the object appended to the hole. If you use this attribute, define the style in the template style sheet. Report generation uses this style if you do not specify one in your report program.

      For inline holes, use a span element to define the default style, i.e., span.STYLE_NAME. For block holes, use the associated paragraph type, such as p.STYLE_NAME or h1.STYLE_NAME.

    • Replace DESCRIPTION with text that describes the purpose of the hole.

  4. Zip the template using the zipTemplate command.

See Also


Related Topics