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, andAutoNumberobjects.A block hole can contain a
Paragraph,Table,OrderedList,UnorderedList,DocumentPart, andGroup.
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.
Unzip the template using the
unzipTemplatecommand.Open the
root.htmlordocpart_templates.htmlfile in an HTML or text editor.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
HOLEIDwith 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_NAMEwith 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
spanelement to define the default style, i.e.,span.STYLE_NAME. For block holes, use the associated paragraph type, such asp.STYLE_NAMEorh1.STYLE_NAME.Replace
DESCRIPTIONwith text that describes the purpose of the hole.
Zip the template using the
zipTemplatecommand.