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
, andAutoNumber
objects.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
unzipTemplate
command.Open the
root.html
ordocpart_templates.html
file 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
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 asp.STYLE_NAME
orh1.STYLE_NAME
.Replace
DESCRIPTION
with text that describes the purpose of the hole.
Zip the template using the
zipTemplate
command.