主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

slreportgen.report.CCaller.createTemplate

类: slreportgen.report.CCaller
命名空间: slreportgen.report

创建 C Caller 模块报告器模板

自 R2022a 起

语法

template = slreportgen.report.CCaller.createTemplate(templatePath)

说明

template = slreportgen.report.CCaller.createTemplate(templatePath)type 指定的位置为 templatePath 指定的报告类型创建 slreportgen.report.CCaller 模板的副本。使用复制的模板作为起点来为您的报告设计自定义的报告器模板。

输入参数

全部展开

模板文件副本的目标路径和文件名,指定为字符向量或字符串标量。如果指定不带文件扩展名的 templatePath,该方法将创建具有所复制的模板文件扩展名的文件。如果包含文件扩展名,它必须与复制的模板文件的扩展名相匹配。

数据类型: char | string

模板类型,指定为 "html""html-file""docx""pdf""pdfa"

输出参量

全部展开

模板副本的路径和文件名,以字符串标量形式返回。指定的模板类型决定了模板的文件扩展名。例如,如果 type 参量为 "pdf",则文件扩展名是 ".pdftx"

数据类型: string

示例

全部展开

slreportgen.report.CCaller 类创建 HTML 模板的副本,并将其以名称 myTemplate 保存在 mytemplates 文件夹中。

template = slreportgen.report.CCaller.createTemplate("mytemplates/myTemplate",'html')

修改模板后,通过将 C Caller 模块报告器的 TemplateSrc 属性设置为新模板文件的路径来使用它。

版本历史记录

在 R2022a 中推出