Custom formatting model advisor report in HTML

3 次查看(过去 30 天)
When generating a model advisor report, in the Model Advisor toolstrip it is possible to add a pdf or word template for your report. Is there a method for doing this for the HTML files? Or simply insert a section of code? I am just modifying the title portion of the report.

回答(1 个)

Garmit Pant
Garmit Pant 2024-6-20
Hello Elijah
From what I understand, you want to customise and incorporate your own template to modify the report generated using the Model Advisor.
The generated report can be customised by modifying the default text template.
Please refer to the following steps to find and modify the report template:
  1. Using Microsoft Word, open the default templatematlabroot/toolbox/simulink/simulink/modeladvisor/resources/templates/default.dotx.
  2. Rename and save the template default.dotx to a writable location. For example, save the template fromdefault.dotx toC:/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.
To use the modified template, please follow the steps below:
  1. From the Model Advisor toolstrip, click Report drop-down, and select Template File.
  2. In the ‘Select Template for Report dialog box, enter the path to the folder where your custom template is placed. In this case, the path isC:/work/ma_format/mytemplate.dotx.
  3. Click OK.
  4. From the toolstrip, click ‘Report drop-down, and select PDF. The Model Advisor generates the report in PDF format with the custom header.
These steps will help you customise the title of the report.
You can also refer to the following documentation to further understand the report generation:
I hope you find the above explanation and suggestions useful!
  2 个评论
Elijah
Elijah 2024-6-20
Yes I understand how to do this using the dotx template, but is there a way to do it for HTML reports generated from the model advisor check?
Garmit Pant
Garmit Pant 2024-6-20
HTML reports generated from the Model Advisor can be edited to have custom text. However, editing the reports generated after running the checks has no effect on the PDF and Word files generated. I have tried editing the HTML report file and then generating the PDF, but the PDF doesn't reflect the edits in the HTML.
Trying to select a non-.dotx file, like an HTML file, results in an error since the custom template is restricted to have the .dotx format.
I hope this helps!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Run Model Advisor Checks 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by