Cannot insert more than one section break with mlreportgen

2 ビュー (過去 30 日間)
Zhiyi TANG
Zhiyi TANG 2017 年 1 月 14 日
コメント済み: Zhiyi TANG 2017 年 3 月 2 日
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);

採用された回答

Paul Kinnucan
Paul Kinnucan 2017 年 2 月 14 日
This is a known problem. See 1511151 Bug Report for a workaround.
  1 件のコメント
Zhiyi TANG
Zhiyi TANG 2017 年 3 月 2 日
Thanks, Paul! Waiting for debugging.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator Task Examples についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by