Documentation

slreportgen.report.SimulinkObjectProperties.createTemplate

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

Create Simulink object properties reporter template

Syntax

template = createTemplate(templatePath,type)
output_args = createTemplate(input_args,Name,Value)

Description

template = 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

Location of the reporter template, specified as a character vector, character array, or template source object.

Format for the output, specified as 'html', 'html-file''docx', or 'pdf'. If you specify a template using the templatePath property, the value for type must match the template type.

Output Arguments

expand all

Name of template, returned as the path and file name of the template. The template file name extension is assigned based on the specified output type. For example, for PDF output, the template name has a .pdftx file extension.

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

Was this topic helpful?