Main Content

mlreportgen.dom.Document.createTemplate

Class: mlreportgen.dom.Document
Namespace: mlreportgen.dom

Create DOM template file

Description

templatePath = mlreportgen.dom.Document.createTemplate(path) creates a copy of the default DOM template at the specified location and returns the full path of the new template. The path argument must include a file name extension that indicates the type of template to create.

example

templatePath = mlreportgen.dom.Document.createTemplate(path,type) creates a copy of the DOM default template of the specified type at the specified location and returns the full path of the new template.

Examples

expand all

Create a Microsoft® Word template file in the current folder.

mlreportgen.dom.Document.createTemplate('MyWordTemplate','docx');

Input Arguments

expand all

Path, including the file name, of the new template file, specified as a character vector or string scalar. If you use the path argument without the type argument, include the file name extension:

  • .htmtx or .htmx for HTML

  • .dotx or .docx for Word

  • .pdftx or .pdf for PDF

  • .htmt or .html for single-file HTML

If you use both the path and type arguments the mlreportgen.dom.Document.createTemplate method ignores the file name extension in the path argument.

Type of template, specified as:

  • 'html' for HTML.

  • 'docx' for Word.

  • 'pdf' for PDF.

  • 'html-file' for single-file HTML. HTML output consists of a single file that contains the text, style sheets, JavaScript®, and images for the report.

Output Arguments

expand all

Full path of the template copy, specified as a character vector. The path includes a file name extension:

  • .htmtx for HTML

  • .dotx for Word

  • .pdftx for PDF

  • .htmt for single-file HTML

Version History

Introduced in R2014b