Main Content

Create, Set Options, and Use Templates for Test Result Reports

Create a Test Results Report

Result reports contain report overview information, the test environment, results summaries with test outcomes, comparison criteria plots, and simulation output plots. You can customize the information included in the report, and you can save the report in three different file formats: ZIP (HTML), DOCX, and PDF.

  1. In the Test Manager, in the Results and Artifacts pane, select results for a test file, test suite, or test case.

    Note

    You can create a report from multiple result sets, but you cannot create a report from multiple test files, test suites, or test cases within results sets.

  2. In the toolstrip, click Report.

  3. Enter the title page information and select the information you want to include in the report. To enable the option to specify the number of plots per page, select Plots for simulation output and baseline.

  4. Select the File Format to use for the generated file and, if desired, change the default File Name and path.

  5. If you created a customized report template, enter the path and name of the Template File. See Generate Reports Using Templates.

  6. If you created a customized report class to change fonts, add tables, add model images, etc., enter the Report Class name. See the "Generate Customized Test Results Report" section of Customize Test Results Reports.

  7. Click Create.

Save Reporting Options with a Test File

You can generate a report every time you run a test case in a test file, using the same report settings each time. To generate a report each time you run the test, set options under Test File Options. These settings are saved with the test file.

  1. In the Test Browser pane, select the test file whose report options you want to set.

  2. Under Test File Options, select Generate report after execution. The section expands, displaying the same report options you can set using the dialog box.

  3. Set the options. To include figures generated by callbacks or custom criteria, select MATLAB figures. For more information, see Create, Store, and Open MATLAB Figures.

  4. Store the settings with your test file. Save the test file.

  5. If you want to generate a report using these settings, select the test file and run the test.

Generate Reports Using Templates

Microsoft Word Format

If you have a MATLAB® Report Generator™ license, you can create reports from a Microsoft® Word template. The resulting report is a Microsoft Word document.

The report generator in Simulink® Test™ fills information into rich text content controls in your Microsoft Word template .dotx document. For more information on how to use rich text content controls or customize part templates, see the MATLAB Report Generator documentation, such as Add Holes in Microsoft Word Templates (MATLAB Report Generator).

In a Microsoft Word template, you can add rich text content controls. Each Simulink Test report section can be inserted into the rich text content controls. The control names are:

  • ChapterTitle — report title

  • ChapterTestPlatform — version of MATLAB used to execute tests

  • ChapterTOC — test results table of contents

  • ChapterBody — test results

For example, the chapter title rich text content control appears in the Microsoft Word template as:

Chapter title content control

To change the control name, right-click the rich text content control and select Properties. Specify the control name, ChapterTitle or other name, in the Title and Tag field.

Content control properties dialog box

To generate a report from the Test Manager using a Microsoft Word template:

  1. In the Test Manager, select the Results and Artifacts pane.

  2. Select results for a test file, test suite, or test case.

  3. In the toolstrip, click Report.

  4. Enter the title page information and specify the information you want to include in the report.

  5. Select DOCX for the File Format.

  6. Specify the full path and filename of your Microsoft Word template in the Template File field.

  7. Click Create.

PDF or HTML Formats

If you have a MATLAB Report Generator license, you can create reports from a PDF or HTML template by using a PDFTX or HTMTX file. To generate a report from the Test Manager using a PDF or HTML template:

  1. In the Test Manager, select the Results and Artifacts pane.

  2. Select results for a test file, test suite, or test case.

  3. In the toolstrip, click Report.

  4. Enter the title page information and specify the information you want to include in the report.

  5. Select ZIP or PDF for the File Format. Selecting ZIP generates an HTML report.

  6. Specify the full path and filename of your template in the Template File field. For PDF, use a PDFTX file. For HTML, use an HTMTX file. For more information on creating templates, see Templates (MATLAB Report Generator).

  7. Click Create.

Related Examples

More About