Main Content

generateReport

Generate report for recent task results

    Description

    generateReport(reportSettings) generates a report with task results.

    After you run tasks using the Process Advisor app or runprocess function, you can call the generateReport function on a padv.ProcessAdvisorReportGenerator object to generate a report of the task results.

    Alternatively, you can use runprocess with the GenerateReport name-value argument specified as true: runprocess(GenerateReport = true).

    This functionality requires CI/CD Automation for Simulink Check.

    example

    Examples

    collapse all

    Run a task and generate a report with the task results.

    Open the Process Advisor example project.

    processAdvisorExampleStart

    This command creates a copy of the Process Advisor example project and opens Process Advisor on the model AHRS_Voter.

    Run a task. For this example, in Process Advisor, point to the task Generate Simulink Web View and click the run button .

    Mouse pointing to run button to run this task and outdated dependent tasks

    Use the generateReport function to generate an HTML report with the task results.

    generateReport(padv.ProcessAdvisorReportGenerator(Format="html-file"))

    The report, ProcessAdvisorReport.html, generates in the current working folder.

    Open and inspect the report. The report shows a summary of the task status, results, inputs, and outputs.

    Input Arguments

    collapse all

    Report generation settings, specified as a padv.ProcessAdvisorReportGenerator object.

    Example: padv.ProcessAdvisorReportGenerator

    Example: padv.ProcessAdvisorReportGenerator(Format="html-file")

    Tips

    • If you want to run tasks and generate a report in batch mode, you can specify the runprocess argument ExitInBatchMode as false and use the exitCode returned by runprocess to exit. For example:

      [buildResult, exitCode] = runprocess(ExitInBatchMode=false);
      rptObj = padv.ProcessAdvisorReportGenerator();
      generateReport(rptObj);
      exit(exitCode);
      Otherwise, the runprocess function automatically exits MATLAB® before the report can generate.

    • Alternatively, you can use runprocess with the GenerateReport name-value argument specified as true: runprocess(GenerateReport = true).

    Alternative Functionality

    You can export a build report that summarizes the task statuses, task results, and other information about the task execution by using the Process Advisor app. In the Process Advisor toolstrip, in the Export section, click Report. In the Export Report dialog box, you can specify options for the report an export a report for the current process by clicking Export.