필터 지우기
필터 지우기

How can i perfect use ColSpan in table with report generator?

조회 수: 4 (최근 30일)
Tong Wang
Tong Wang 2018년 7월 8일
댓글: Tong Wang 2018년 7월 9일

I want to remove the line in the red circle

i tried use ColSpan like this

 table.entry(3,2).ColSpan = 2;

then it just adds another column automatically

this is annoying, then i saw there is a property 'ColSep' for table, but it failed when i tried to apply this (ColSep set to 'none') on table entry (oh, of course). I'd like to know if there is a good way to perfect use 'ColSpan' without coming new Column? Or can we do something like 'ColSep' for an entry?

채택된 답변

Krishnan Ramkumar
Krishnan Ramkumar 2018년 7월 9일
Hello Tong,
You can update the RowSep, ColSep styles of TableEntry using the style property to remove the TableEntry borders.
table.entry(1,2).Style = [table.entry(1,2).Style {mlreportgen.dom.ColSep('none'), mlreportgen.dom.RowSep('none')}];
Below is the sample code on using the RowSep, ColSep for particular table entry
import mlreportgen.dom.*
d = Document('ColSepCheck', 'pdf');
table = Table(magic(4));
table.RowSep = 'Solid';
table.ColSep = 'Solid';
table.Border = 'Solid';
% append the ColSep and RowSep styles to the existing TableEntry styles.
table.entry(1,2).Style = [table.entry(1,2).Style {mlreportgen.dom.ColSep('none'), mlreportgen.dom.RowSep('none')}];
append(d,table);
close(d);
rptview(d);
On the other hand RowSpan and ColSpan properties are used to span the TableEntry to multiple rows/columns.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB 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