Package: mlreportgen.dom
Superclasses:
Create report template object
Create a report template object.
Use mlreportgen.dom.Template
objects to create templates. For example, you
can append DOM content (e.g., Text
, Paragraph
,
Image
) objects and TemplateHole
objects) to a
Template
object to create a template containing fixed content
with holes for generated content.
Note
Word for Mac does not support creating holes for DOM API templates. If you need to
create a Word template for generating Word documents on a Mac, you can create a
template using the DOM API. Create a Template
object and use
mlreportgen.dom.TemplateHole
to add
holes. Alternatively, use Word on Windows® to create your template and copy the template to your Mac.
creates
a template object based on the default HTML template. The resulting
template is in the current folder and uses the name templateObj
= Template()Untitled.htmtx
.
Append content and use a corresponding close
command
to generate the template file.
creates
a template object that outputs a template file at the specified location.
The default template type if you do not specify an extension is HTML.templateObj
= Template(templatePath
)
creates
the template of the specified type. If you specify an extension using templateObj
= Template(templatePath
,type
)templatePath
,
the types must match.
Tip
Use a variable for the type
argument to simplify
your code. See Create a Template and Add Content for an example.
creates
a template based on the template templateObj
= Template(templatePath
,type
,sourceTemplatePath
)sourceTemplatePath
.
Use the Template
methods the same way you
use the corresponding Document
methods.
Method | Purpose |
---|---|
Append document element to the document. | |
Close this document. You cannot close a document if it has not been opened or was previously closed. | |
Create default template. | |
Fill document hole. | |
Get core properties of document. | |
Get image directory for the document. | |
Get generated image name prefix for the document. | |
Get relative path of main part of output document. | |
Get full path of main part of output document. | |
Move to next template hole. | |
Open this document. You cannot open a document if it was previously opened or closed. | |
Append file to OPC package of document. | |
Set core properties of document element. |