Cannot insert more than one section break with mlreportgen
2 次查看(过去 30 天)
显示 更早的评论
Hi there,
I'm doing Programmatic Report Creation, now I'm stuck at cannot insert a second section break into docx file.
I tried with my own code and example code ( referred this page ) on macOS and Windows, all failed. I doubt that is it a bug?
Here is the example code I used, I'm curious if anyone can make the second section break appear.
Platform: MATLAB 2016a, macOS 10.12.1 & Windows 10
import mlreportgen.dom.*
rpt = Document('test','docx');
append(rpt,Heading(1,'Magic Square Report','Heading 1'));
sect1 = DOCXPageLayout;
sect1.PageSize.Orientation = 'landscape';
sect1.PageSize.Height = '8.5in';
sect1.PageSize.Width = '11in';
append(rpt,Paragraph('The next page shows a magic square.'),sect1);
table = append(rpt,magic(22));
table.Border = 'solid';
table.ColSep = 'solid';
table.RowSep = 'solid';
append(rpt,Heading(1,'Magic Square Report','Heading 1'));
sect2 = DOCXPageLayout;
sect2.PageSize.Orientation = 'landscape';
sect2.PageSize.Height = '8.5in';
sect2.PageSize.Width = '11in';
append(rpt,Paragraph('The next page shows a magic square.'),sect2);
table2 = append(rpt,magic(22));
table2.Border = 'solid';
table2.ColSep = 'solid';
table2.RowSep = 'solid';
close(rpt);
rptview(rpt.OutputPath);
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Title Pages, Tables of Contents, Lists of Figures, Tables, and Captions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!