mlreportgen.dom.Text StyleName property not recognized
Show older comments
Using Report Generator, I'm trying to set the property StyleName of a Text object:
import mlreportgen.dom.*;
rpt = Document(reportPath, 'docx', templatePath);
dateText = Text(date,'Cita');
append(rpt, dateText);
However, the added text does not have the assigned style when I open the output document.
I have checked that the style name in the word template matches with the assigned string:

I hope the fields can be understand even in spanish (nombre=name), what could be missing?
Thanks in advance for any help.
Kind regards,
Guillermo
Answers (1)
Ritam
on 16 Apr 2026
Please execute the below command
>> rptconvert -clearcache
And then try generating the report again.
If the above workaround does not resolve your issue, please reach out to MathWorks Technical Support.
Categories
Find more on Page Layout 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!