Custom formatting model advisor report in HTML
Show older comments
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.
Answers (1)
Garmit Pant
on 20 Jun 2024
0 votes
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:
- Using Microsoft Word, open the default template matlabroot/toolbox/simulink/simulink/modeladvisor/resources/templates/default.dotx.
- Rename and save the template ‘default.dotx’ to a writable location. For example, save the template from ‘default.dotx’ to C:/work/ma_format/mytemplate.dotx.
- 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:
- From the Model Advisor toolstrip, click ‘Report’ drop-down, and select ‘Template File’.
- 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 is C:/work/ma_format/mytemplate.dotx.
- Click OK.
- 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 Comments
Elijah
on 20 Jun 2024
Garmit Pant
on 20 Jun 2024
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!
Categories
Find more on Simulink Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!