mlreportgen.dom.Text StyleName property not recognized

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)

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.

Products

Release

R2025b

Asked:

on 6 Apr 2026

Answered:

on 16 Apr 2026

Community Treasure Hunt

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

Start Hunting!