Main Content

slreq.generateReport

Generate requirements reports

Description

myReportPath = slreq.generateReport(myReqSets) generates a report with the default options for the requirement sets specified by myReqSets.

example

myReportPath = slreq.generateReport(myReqSets,myReportOpts) generates a requirements report using the options specified by myReportOpts.

example

Examples

collapse all

Open the ShortestPath project.

proj = openProject("ShortestPath");

Load the shortest_path_func_reqs requirement set.

myReqSet = slreq.load("shortest_path_func_reqs");

Generate the requirements report.

myReportPath = slreq.generateReport(myReqSet);
Starting report generation...
0%****************************************************100%
Requirements Toolbox report generated: C:\Users\jdoe\MATLAB\Examples\GenerateRequirementsReportExample\ShortestPath\slreqrpt_20241008.docx

Open the ShortestPath project.

proj = openProject("ShortestPath");

Get the default report generation options.

myReportOpts = slreq.getReportOptions;

Load the shortest_path_func_reqs requirement set.

myReqSet = slreq.load("shortest_path_func_reqs");

Run the tests for the requirement set.

status = runTests(myReqSet);

Specify the report path. Exclude the table of contents from the report.

myReportOpts.reportPath = fullfile(proj.RootFolder, ...
    "FunctionalRequirementsReport.html");
myReportOpts.includes.toc = false;

Generate the requirements report.

myReportPath = slreq.generateReport(myReqSet,myReportOpts);
Starting report generation...
0%****************************************************100%
Requirements Toolbox report generated: C:\Users\ahoward\OneDrive - MathWorks\Documents\MATLAB\ExampleManager\ahoward.examples\slrequirements-ex92550242\ShortestPath\FunctionalRequirementsReport.html

Input Arguments

collapse all

Requirement sets to include in the report, specified as an slreq.ReqSet array or "all", which includes all of the loaded requirement sets in the report.

Report generation options, specified as a structure that has these fields:

Tip

Create this structure by using the slreq.getReportOptions function. To change the settings, modify the structure before using it as an input argument.

Report file name and path, specified as a character vector.

Option to automatically open the report, specified as a logical 1 (true) or 0 (false).

Report title, specified as a character vector.

Report authors, specified as a character vector.

Content included in the report, specified as a structure that has these fields:

Option to include the table of contents, specified as a logical 1 (true) or 0 (false).

Option to include the report generation date, specified as a logical 1 (true) or 0 (false).

Option to include the requirement set revision number, specified as a logical 1 (true) or 0 (false).

Option to include requirement properties, specified as a logical 1 (true) or 0 (false).

Option to include links, specified as a logical 1 (true) or 0 (false).

Option to include the requirement change information, specified as a logical 1 (true) or 0 (false).

Link grouping used by report, specified as 'Artifact' or 'LinkType'.

Option to include requirement keywords, specified as a logical 1 (true) or 0 (false).

Option to include requirement comments, specified as a logical 1 (true) or 0 (false).

Option to include the implementation status, specified as a logical 1 (true) or 0 (false).

Option to include the verification status, specified as a logical 1 (true) or 0 (false).

Option to include empty requirement properties, specified as a logical 0 (false) or 1 (true).

Option to include the rationale, specified as a logical 1 (true) or 0 (false).

Option to include custom attributes, specified as a logical 1 (true) or 0 (false).

Output Arguments

collapse all

Report file path, returned as a character vector.

Tips

  • To include the most recent verification status in the requirements report, run the tests for the requirement sets before you generate the report. To run the tests programmatically, use the runTests function. For more information about running the tests interactively, see Review Requirements Verification Status.

Version History

Introduced in R2018a