Documentation

slreportgen.report.Report class

Package: slreportgen.report
Superclasses:

Superclass for report creation

Description

slreportgen.report.Report is a container for a report based on Simulink®reporters and DOM objects. Use this object to generate an HTML, PDF, or Word report based on templates in a template library.

Note

Use objects of this type, instead of mlreporgen.report.Report, to create Simulink reports, which are reports that use Simulink reporters to generate content. You can also use MATLAB®reporters and DOM objects to generate Simulink report content.

Construction

report = slreportgen.report.Report() returns a report object report with the default report type (PDF) and a default file name (untitled.pdf).

report = slreportgen.report.Report(path) uses the specified output path for the report.

report = slreportgen.report.Report(path,type) creates the specified type of report.

report = slreportgen.report.Report(path,type,template) uses the specified template.

report = slreportgen.report.Report(Name,Value) sets properties using name-value pairs. You can specify multiple name-value pair arguments in any order. Enclose each property name in single quotes.

Input Arguments

expand all

See the OutputPath property.

See the Type property.

See the TemplatePath property.

Properties

expand all

Report document output path, specified as a string or character array. The path is the location in the file system where the report output document is stored. The path can be a full path or a path relative to the current MATLAB folder, for example, 'C:/myreports/reportA.docx' or 'reportA'. If the file name does not have a file extension corresponding to the Type property, the appropriate file extension is added.

Output type, specified as one of these values.

  • 'HTML' — HTML report packaged as a zipped file containing the HTML file, images, style sheet, and JavaScript® files of the report.

  • 'HTML-FILE' — HTML report as a single HTML file containing the text, style sheet, JavaScript, and base64-encoded images of the report

  • 'PDF' — PDF file

  • 'DOCX'Microsoft® Word document

If you specify a template using the TemplatePath property, the value for Type must match the template type.

Page layout options for this report, specified as a report layout object. See mlreporten.report.ReportLayout.

Locale or language, specified as the ISO 639-1 two-letter language code of the locale for which this report is to be generated. The default [] specifies the language of the system locale, for example, English on an English system. The Report API uses the language code to translate chapter title prefixes to the language of the specified locale. Translations are provided for the following locales: af, ca, cs, da, de, el, en, es, et, eu, fi, fr, hu, id, it, ja, ko, nl, nn, no, pl, pt, ro, ru, sk, sl, sr, sv, tr, uk, xh, and zh. If you specify an unsupported locale, the English version is used. See ISO 639-1 codes.

Location of template used to format the report, specified as a string or character array. Use this property to specify a custom template for this report.

This read-only property is an mlreportgen.dom.Document that is used to generate the content of the report.

This read-only property is a containers.Map object that contains information for generating the report, such as the hierarchical level of the current report section.

Debug mode, specified as a logical. If you set Debug to true, the temporary files for the report are stored in a subfolder of the report folder. In debug mode, these files are not deleted when the report is closed.

Methods

This class uses the same methods as the MATLAB version. Instead of using mlreportgen in the class name, use slreportgen. See mlreportgen.report.Report for a list of methods.

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects (MATLAB).

Introduced in R2017b

Was this topic helpful?