Format table for mlreportgen.ppt

조회 수: 5 (최근 30일)
Tristany Armangue
Tristany Armangue 2019년 6월 4일
답변: Rahul Singhal 2019년 6월 20일
I am creating a presentation programmatically for the results of my code. I have various tables that I insert in those slides, I have been able to format font size and boldface, for example, but have not been able to format table borders. Currently the tables display without any borders, I would like to add all borders. My code for one of those tables is below:
paramTable = Table();
% First row of table
tr1 = TableRow();
tr1.Style = {Bold(true),FontSize('10pt')};
% First row cells
tr1te1Text = Paragraph('');
tr1te2Text = Paragraph('AAA');
tr1te1 = TableEntry();
tr1te2 = TableEntry();
append(tr1te1,tr1te1Text);
append(tr1te2,tr1te2Text);
append(tr1,tr1te1);
append(tr1,tr1te2);
% Second row
tr2 = TableRow();
tr2.Style = {FontSize('10pt')};
% Second row cells
tr2te1Text = Paragraph('XXX');
tr2te2Text = Paragraph('YYY');
tr2te1 = TableEntry();
tr2te2 = TableEntry();
append(tr2te1,tr2te1Text);
append(tr2te2,tr2te2Text);
append(tr2,tr2te1);
append(tr2,tr2te2);
append(paramTable,tr1);
append(paramTable,tr2);
table = find(textSlide,'Table');
replace(table,paramTable);

답변 (1개)

Rahul Singhal
Rahul Singhal 2019년 6월 20일
Hi Tristany,
Currently, the programmatic table formating options are limited for the PowerPoint API and the team is working to introduce these options in the future releases.
For your use case, you can alternatively use the StyleName property of the Table to get the desired output.
To get the list of valid table style names in a presentation, you can use mlreportgen.ppt.Presentation.getTableStyleNames.
As an example, to just add borders to your table, you can use 'No Style, Table Grid' style name as:
paramTable = Table();
paramTable.StyleName = 'No Style, Table Grid';
Thanks,
Rahul

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by