Format table for mlreportgen.ppt

5 visualizaciones (últimos 30 días)
Tristany Armangue
Tristany Armangue el 4 de Jun. de 2019
Respondida: Rahul Singhal el 20 de Jun. de 2019
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);

Respuestas (1)

Rahul Singhal
Rahul Singhal el 20 de Jun. de 2019
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

Categorías

Más información sobre MATLAB Report Generator en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by