Main Content

Create an Embedded Web View Report Generator

To create a MATLAB® program that generates an Embedded Web View report:

  1. Create a MATLAB class that defines a report object that generates a Web View report. See Create an Embedded Web View Report Generator Class for a summary of the steps to create and define the class.

  2. To generate the report, use this class in a MATLAB program. See Generate an Embedded Web View Report.

For general information and how to view and navigate a generated report, see Embedded Web View Reports.

Create an Embedded Web View Report Generator Class

To create an Embedded Web View report class, use this workflow:

  1. Open the MATLAB editor.

  2. To create a default class definition file, select New > Class.

  3. Replace the default content of the new class definition file with this Embedded Web View class definition template:

    classdef REPORT_GENERATOR < slreportgen.webview.EmbeddedWebViewDocument
       % Report generator constructor
       function rptev = REPORT_GENERATOR(reportName,modelName)
       % Report content generator 
       function fillContent(rptev)

  4. Replace the placeholder, REPORT_GENERATOR, with the name of your report generator.

  5. To save your new class definition file using the name you used to replace the REPORT_GENERATOR placeholder, select Editor > Save As.

  6. To specify the export options and warning suppression option for your report generator, edit the template constructor. See Specify Export Options for Embedded Web View Report and Suppress Link Warning Messages for Embedded Web View Report, respectively.

  7. To include the report content, table of contents, model, and hyperlinks to embed in your report, edit the content generator (fillContent) function. These topics describe how to add content to the Embedded Web View report generator. You can perform these tasks in any order.

  8. Save your changes to the new class definition file.