MATLAB: Report only showing names of the objects instead of their content

documentMATLABMATLAB Report Generatorreport generator

Hello everyone!
I have a code generating a full report. But now the word file only gives me the name of the objects in the report and not the actual content like this:
Capture.PNG
Do anyone know where does this problem comes from?
My code is
rpt = Document('Report','docx');
%% title page generation
tp = TitlePage;
tp.Title = 'Report';
tp.Subtitle = 'This report is generated from the test.';
tp.Author = 'Jack'
append(rpt, tp);
%% Summary
ChapterRegression = Chapter;
ChapterRegression.Title = 'Summary';
append(rpt, ChapterRegression)
close(rpt)
My dotx template just have one Rich Text Content Control hole.
Thank you in advance!

Best Answer

You can not add Report API objects like TitlePage to a DOM Document. Use mlreportgen.report.Report instead of the DOM Document. You can add both DOM and Report API objects to a Report object.