slreportgen.report.SimulinkObjectProperties.createTemplate

Class: slreportgen.report.SimulinkObjectProperties
Package: slreportgen.report

Create Simulink object properties reporter template

Syntax

template = slreportgen.report.SimulinkObjectProperties.createTemplate(templatePath,type)
output_args = createTemplate(input_args,Name,Value)

Description

template = slreportgen.report.SimulinkObjectProperties.createTemplate(templatePath,type) creates a copy of the default Simulink® object properties template specified by type at the location specified by templatePath. To design a custom Simulink object properties template for your report, use the copied template as a starting point t.

output_args = createTemplate(input_args,Name,Value) <verb phase> with additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

Path and file name of the new template, specified as a character vector or string scalar.

Type of template, specified as 'html', 'html-file', 'docx', or 'pdf'.

Output Arguments

expand all

Path and file name of the copy of the template, returned as a string scalar. The file name extension of the template is assigned based on the specified output type. For example, if type is 'pdf', the file name extension is .pdftx.

Examples

Create a Report Template

Before you run this example, create a copy of the default HTML Simulink object properties template in the mytemplates folder. Name the copied template myObjectsReporter.htmtx. Edit the template as desired. To use the new template, assign its path to the slreportgen.report.SimulinkObjectProperties TemplateSrc property.

import slreportgen.report.*
import mlreportgen.report.*
rpt = slreportgen.report.Report('My Report','html');
model_name = 'vdp');
load_system(model_name);

chapter = Chapter(model_name);
chart = block2chart('sf_car/shift_logic');
rptr = SimulinkObjectProperties(model_name);
template = SimulinkObjectProperties.createTemplate...
     ('mytemplates\myObjsReporter','html');
rptr.TemplateSrc = template;

Introduced in R2017b