Main Content

slreportgen.webview.EmbeddedWebViewDocument Class

Namespace: slreportgen.webview
Superclasses: slreportgen.webview.WebViewDocument

Create a report generator that generates an HTML report containing an interlinked document and associated web view

Description

Creates a report generator that generates an HTML report containing a document and a web view of one or more Simulink® models, with two-way hyperlinks between the document and the web view.

This class provides the following facilities for generating embedded web view reports:

  • A report generator based on an slreportgen.report.Report object. You can use DOM and Report APIs to fill the document content.

  • An HTML template with three panels for a table of contents (TOC), document content, and a web view, respectively

  • Template holes to be filled with the document content and a web view, respectively. The hole for the web view is named slwebview and is located in the right panel of the report. The hole for document content is named Content and is located in the center panel of the report.

  • Methods for filling the document and web view holes.

  • Methods for creating two-way hyperlinks between the document content and embedded webview(s)

  • JavaScript that generates a TOC from document headings when the report opens in a browser

  • Model export options that allow you to specify the models and subsystems to be embedded as web views in the generated report

  • Methods for retrieving elements (diagrams, blocks, charts, etc.) from models to be embedded as web views in the report

The slreportgen.webview.EmbeddedWebViewDocument class is a handle class.

Creation

Description

rptgen = slreportgen.webview.EmbeddedWebViewDocument(rptname,model) creates a report generator that generates a report having the specified file name and containing a web view of the specified model. Use the generator’s fill method to generate the web view and embed the web view in the document. Use the generator’s close method to output the document as a ZIP file or folder containing the HTML document.

rptgen = slreportgen.webview.EmbeddedWebViewDocument(rptname,model1,model2,...modeln) creates a report generator that includes two or more models in the web view that it creates. This constructor assigns an array of default slreportgen.webview.ExportOptions objects to the generator’s ExportOptions property, one for each of the models to be included in the generated document’s web view. You can use the objects to specify custom export options for each of the models to be included in the web view exported to the generated document.

rptgen = slreportgen.webview.EmbeddedWebViewDocument(rptname,{model1,model2,...modeln}) creates a generator that includes the specified models in the web view that it embeds in the output document.

rptgen = slreportgen.webview.EmbeddedWebViewDocument(rptname) creates a generator that embeds models specified by the Diagrams property of the generator’s ExportOptions property, for example:

import slreportgen.webview.*
rptgen = EmbeddedWebViewDocument("myDoc");
rptgen.ExportOptions.Diagrams = "myModel";

Input Arguments

expand all

Name of the ZIP file and/or folder containing the report generated by this generator. Use this generator’s PackageType property to specify whether to package the generated report as a file or a folder or both. If you specify an extension, the extension must be .htmx. If you do not specify an extension, the report generator appends .htmx.

Name of model, specified as a character vector, to be embedded in the generated report as a web view.

Properties

expand all

Identifier of current hole in document, stored as a character vector or string scalar.

Attributes:

Dependent
true
NonCopyable
true

Data Types: char | string

Web view export options, specified as an array of slreportgen.webview.ExportOptions objects, one for each model or set of models to be included in the web view exported to the generated report. The constructor of the generator constructor sets this property with default values for the models you specify. Use the properties of the ExportOptions object or objects to customize export of the models to the generated web view. For example, you can specify additional models to include or whether to include the block diagrams of masked subsystems and library blocks.

Whether to include user notes in the web view, specified as "on" or "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

  • "on" — includes user notes in the web view.

  • "off" — does not include user notes in the web view.

Whether to overwrite an existing report with the same name, specified as "on" or "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

  • "on" — overwrites the existing report.

  • "off" — generates the report under a new name.

Status of the report being generated, specified as "unopened" or "opened".

Attributes:

Dependent
true
NonCopyable
true

Data Types: char | string

Path of the report output directory, specified as a character vector or a string scalar.

Attributes:

Dependent
true
NonCopyable
true

Data Types: char | string

Packaging to use for files generated for output document, specified as one of these values:

  • "both" — Creates both zipped and unzipped output

  • "zipped" — Creates a ZIP file with an .htmx extension

  • "unzipped" — Creates a folder of files

Attributes:

Dependent
true
NonCopyable
true

Data Types: char | string

Path to the HTML template to use to generate this report, specified as a character vector or string scalar. The template has an .htmtx extension. This property points to a default HTML template. To use a custom template, set this property to the path of the custom template.

Attributes:

Dependent
true
NonCopyable
true

Data Types: char | string

Text to display in the title bar of the HTML browser used to display the generated report, specified as a character vector or a string scalar. The default text is "Simulink Web View - Created by Simulink Report Generator".

Attributes:

Dependent
true
NonCopyable
true

Data Types: char | string

Whether to check validity of hyperlinks between the generated document and web view, specified as "on" or "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

  • "on" — checks the validity of hyperlinks between the generated document and web view.

  • "off" — does not check the validity of hyperlinks between the generated document and web view.

Generates a warning at the command line if the link target that you specify does not exist or if you specify a link from a model element that already has a link. Validation checking increases the time required to generate a report. For this reason, consider using link validation checking only when debugging your report.

Methods

expand all

Version History

Introduced in R2017a

expand all