mlreportgen.dom.Template 类
命名空间: mlreportgen.dom
超类: mlreportgen.dom.Document
创建报告模板对象
描述
使用 mlreportgen.dom.Template 对象创建报告模板。例如,您可以将 DOM 内容(如 Text、Paragraph 或 Image 对象和 TemplateHole 对象)追加到 mlreportgen.dom.Template 对象,以创建包含固定内容的模板,其中有用于生成内容的空位。
注意
Microsoft® Word 适用于 Mac 的版本不支持为 DOM API 模板创建孔。要在 Mac 上创建用于生成 Word 文档的 Word 模板,请使用以下方法之一:
创建一个
mlreportgen.dom.Template对象,并使用mlreportgen.dom.TemplateHole类添加孔。在 Windows® 上的 Word 中创建您的模板,然后将模板复制到您的 Mac。
mlreportgen.dom.Template 类是一个 handle 类。
创建对象
描述
创建一个模板对象并将 TemplatePath 属性设置为 templateObj = mlreportgen.dom.TemplateUntitled.htmtx。
创建一个模板对象并将 TemplatePath 属性设置为 templateObj = mlreportgen.dom.Template(templatePath)templatePath。如果 templatePath 不包含文件扩展名,则 Type 属性设置为默认值 HTML。
还将 Type 属性设置为 templateObj = mlreportgen.dom.Template(templatePath,fileType)fileType。如果 templatePath 包含文件扩展名,则 fileType 必须与 templatePath 指定的文件扩展名匹配。
根据 templateObj = mlreportgen.dom.Template(templatePath,fileType,sourceTemplatePath)sourceTemplatePath 指定的模板创建模板对象。
输入参量
属性
方法
示例
版本历史记录
在 R2014b 中推出