Add space and style to sliced table - MATLAB Report Generator

조회 수: 3 (최근 30일)
dan kin
dan kin 2020년 5월 11일
편집: dan kin 2020년 5월 12일
I am trying to add some space between the sliced table but I get the error below. In addition, how can I change the table header style?
Error:
Error using mlreportgen.dom.Document/append
Cannot append child that has a parent.
Code:
function ReportButtonPushed(app, event)
import mlreportgen.dom.*;
import mlreportgen.report.*
import mlreportgen.utils.*
mTable = MATLABTable(app.dataReport);
p = Paragraph();
p.Style = {LineSpacing(1.5)};
slicer = TableSlicer("Table",mTable,"MaxCols",5,"RepeatCols",1);
totcols = slicer.MaxCols - slicer.RepeatCols;
slices = slicer.slice();
d = Document('slice','pdf');
d.OutputPath = ['E:/','Sliced'];
for slice=slices
append(d,MATLABTable([app.dataReport(:,1) app.dataReport(:,slice.StartCol:slice.EndCol)]));
append(d, p);
end
close(d);
rptview(d.OutputPath);
end

답변 (1개)

Sean de Wolski
Sean de Wolski 2020년 5월 11일
You're appending the same paragraph multiple times. It can only be appended once. Clone it first
append(d,clone(p))
  댓글 수: 1
dan kin
dan kin 2020년 5월 12일
편집: dan kin 2020년 5월 12일
The app.dataReport is a long table (more than one page) and I can not see the distance between the slice tables even when the
p.Style = {LineSpacing(15)};

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by