主要内容

mlreportgen.report.Report.createTemplate

类:mlreportgen.report.Report
包:mlreportgen.report

创建报表模板

语法

template = mlreportgen.report.Report.createTemplate(templatePath,type)

描述

模板= mlreportgen.report.Report.createTemplate (templatePath,类型属性指定的默认报表模板的副本类型在指定的位置templatePath.您可以使用复制的模板为报表设计自定义模板。

输入参数

全部展开

新模板的路径和文件名,指定为字符向量或字符串标量。

模板类型,为“html”,“html文件”,“多克斯”,或“pdf”

输出参数

全部展开

模板副本的路径和文件名,作为字符串标量返回。模板的文件扩展名为模板类型的扩展名。例如,如果类型参数是“pdf”,则文件扩展名为.pdftx

例子

全部展开

为报表创建HTML模板的副本,并以名称保存它myReportTemplatemytemplates文件夹中。

template = mlreportgen.report.Report.createTemplate...“mytemplates / myReportTemplate”,“html”);

修改模板后,可以通过设置TemplatePath的属性mlreportgen.report.Report对象。

版本历史

在R2017b中引入