Why MATLAB Standalone application for report generation having some sections missing

조회 수: 2 (최근 30일)
Hello, May I make a quick enquery about report generation in stand alone application. I have written some code that should generate report, which works very well when in MATLAB. However, after compiling into a standalone application, the standalone application generates a report with no table of contnets and the all figures have the same figure numbering. That is, all figures have been numbered 'Figure 1.1' which is undesired. How can I solve this, is there some commands I have missed or files that I need to add to the code before compiling? Note that before my code I had makeDOMCompilable() command which I thought should be able to solve the problem but unfortunately, it didnt.

채택된 답변

Aneela
Aneela 2024년 11월 3일
I understand that you are trying to generate a report using a standalone application and encountered that the report generated using standalone application did not include Table of Contents.
I was able to reproduce the issue when I specified the report format as 'docx', which did not include Table of contents. However, I compiled another standalone application by specifying the report format as 'pdf'. This 'PDF' report included table of contents.
You can use the below code for reference:
function report
makeDOMCompilable();
import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report('Report with TOC');
add(rpt, TitlePage(Title='Report',Subtitle='with TOC'));
toc = TableOfContents;
toc.Title = Text('Table of Contents');
toc.Title.Color = 'green';
toc.NumberOfLevels = 2;
add(rpt,toc);
ch = Chapter('First Chapter');
add(ch,Section('First Subsection'));
add(ch,Section('Second Subsection'));
add(rpt,ch);
add(rpt,Chapter('Second Chapter'));
add(rpt,PDFPageLayout);
p = Paragraph('Appendix');
p.Style = {OutlineLevel(1), Bold, FontSize('18pt')};
add(rpt,p);
close(rpt);
rptview(rpt);
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Title Pages, Tables of Contents, Lists of Figures, Tables, and Captions에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by