Main Content

Create Embedded Web View Report Generators

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 Embedded Web View Report Generator Classes 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 Embedded Web View Reports.

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

Create Embedded Web View Report Generator Classes

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
     methods
         
       % Report generator constructor
       function rptev = REPORT_GENERATOR(reportName,modelName)
         rptev@slreportgen.webview.EmbeddedWebViewDocument(...
           reportName,modelName);
       end
            
       % Report content generator 
       function fillContent(rptev)
         
       end        
     end   
    end
    

  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 Reports and Suppress Link Warning Messages for Embedded Web View Reports, 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.