Save report HTML file from HTMX
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi there,
How do I save an HTML report as an HTML file?
import mlreportgen.report.*
reportPath = fullfile(pwd, 'MyReportName');
rpt = mlreportgen.report.Report(reportPath,'html');
ch = Chapter;
ch.Title = 'Title string';
myReportTable = mlreportgen.dom.FormalTable(cellArrayOfStrings,matlabTable);
add(ch,myReportTable);
add(rpt,ch);
rptview(rpt)
When I generate a PDF report (in the code above, line 3 would have 'pdf' instead of 'html' as input), it saves the PDF file at the location of reportPath, but when I generate it in HTML format, the file created is HTMX which I cannot open outside of MATLAB.
Thanks in advance.
댓글 수: 2
채택된 답변
Mary Abbott
2019년 3월 21일
To generate a report as a single HTML file, set the report type to html-file.
rpt = mlreportgen.report.Report(reportPath,'html-file');
More details about the different types of reports can be found at the following link:
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!