Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.report.Report class

Package: mlreportgen.report
Superclasses:

Superclass for report creation

Description

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

Construction

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

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

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

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

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 OutputPath property.

See Type property.

See 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 https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes.

Location of template used to format the report, specified as a string or character array. You can 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 Boolean value. 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

addAdd content to report
close Close and generate report
createTemplateCreate report template
customizeReportCreate class derived from Report class
fillFill report template holes
generateFileName Generate temporary report file name
getClassFolder Report class definition file location
getContext Get report context value
isdocx Check if Word report
ishtml Check if multifile HTML report
ishtmlfile Check if single-file HTML report
ispdf Check if PDF report
open Opens the report
rptview Open generated report file in viewer
setContext Set report context value

Copy Semantics

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

Introduced in R2017b

Was this topic helpful?