Documentation

Generate Model Advisor Reports in Adobe PDF and Microsoft Word Formats

By default, when the Model Advisor runs checks, it generates an HTML report of check results in the slprj/modeladvisor/model_name folder. On Windows® platforms, you can generate Model Advisor reports in Adobe® PDF and Microsoft® Word .docx formats.

The beginning of the PDF and Microsoft Word versions of the Model Advisor reports contain the:

  • Model name

  • Simulink® version

  • System

  • Treat as Referenced Model

  • Model version

  • Current run

To generate a Model Advisor report in Adobe PDF or Microsoft Word:

  1. In the Model Advisor window, navigate to the folder that contains the checks that you ran.

  2. Select the folder. The right pane of the Model Advisor window displays information about that folder. The pane includes a Report box.

  3. In the Report box, click Generate Report.

  4. In the Generate Model Advisor Report dialog box, enter the path to the folder where you want to generate the report. Provide a file name.

  5. In the Generate Model Advisor Report dialog box File format field, select PDF or Word.

  6. Click OK. The Model Advisor generates the report in PDF or Microsoft Word format to the location that you specified.

Modify Default Template

If you have a MATLAB® Report Generator™ license, you can modify the default template that the Model Advisor uses to generate the report in PDF or Microsoft Word.

The default template contains holes that the Model Advisor uses to populate the generated report with information about the analysis. If you want your Model Advisor report to contain the analysis information, do not delete the holes. When the Model Advisor uses the template to generate the report, analysis information overrides the text that you enter in the template hole field.

Template HoleIn generated report, displays
ModelNameModel name
SimulinkVersionSimulink version
SystemNameSystem name
TreatAsMdlRefWhether or not model is treated as a referenced model
ModelVersionModel version
CurrentRunModel Advisor analysis time stamp
PassCountNumber of checks that pass
FailCountNumber of checks that fail
WarningCountNumber of checks that cause a warning
NrunCountNumber of checks that did not run
TotalCountTotal number of checks
CheckResultsResults for each check

This example shows how to add a header to a PDF version of a Model Advisor report.

  1. Using Microsoft Word, open the default template matlabroot/toolbox/simulink/simulink/modeladvisor/resources/templates/default.dotx.

  2. Rename and save the template default.dotx to a writable location. For example, save template default.dotx to C:/work/ma_format/mytemplate.dotx.

  3. In the template C:/work/ma_format/mytemplate.dotx file, add a header. For example, in the template header, add the text My Custom Header. Save the template as a Microsoft Word .dotx file.

  4. In the Model Advisor window Report pane, click Generate Report.

  5. In the Generate Model Advisor Report dialog box:

    • Enter the path to the folder where you want to generate the report and provide a file name.

    • Set File format to PDF.

    • Select View report after generation.

    • Set Report template to C:\work\ma_format\mytemplate.dotx.

  6. Click OK. The Model Advisor generates the report in PDF format with a custom header. Because the template mytemplate.dotx contains holes that Model Advisor uses to populate the generated report, the report contains information about the Model Advisor analysis. For example, the report contains the model name, model version, and number of checks that pass.

Related Topics

Was this topic helpful?