How do I use a custom Word template for headers and footers in MATLAB Report Generator?
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 4 de Nov. de 2019
Editada: MathWorks Support Team
el 11 de Nov. de 2019
I have created a custom template in MS Word by editing the header/footer sections and saving the document as a DOTX template file. How do I use this template with MATLAB Report Generator?
Respuesta aceptada
MathWorks Support Team
el 12 de Nov. de 2019
Editada: MathWorks Support Team
el 11 de Nov. de 2019
To use a custom-made Word template, create a new document using the "mlreportgen.dom.Document" constructor and set the "templatePath" property to your DOTX file. Here is the documentation for a Document object:
And here is a simple example using a custom-made template file from MS Word within the MALTAB Report Generator API:
import mlreportgen.dom.*
d = Document('MyWordDoc', 'docx', 'CustomTemplate.dotx'); %assuming template is in same folder; otherwise, specify full path
open(d);
append(d,'Hello World'); % add some text to generate doc
close(d);
rptview(d.OutputPath)
This formatting for headers and footers will disappear if you are adding chapters to the report. To customize chapter page headers, see the following documented examples for creating and editing chapter templates:
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!