mlreportgen.ppt.TemplateTable Class
Namespace: mlreportgen.ppt
Table from template presentation slide
Description
Objects of the mlreportgen.ppt.TemplateTable
class represent template
tables. A template table is a table that comes from a slide in the template presentation.
Customize a template table by modifying properties of the associated
mlreportgen.ppt.TemplateTable
object. Replace a template table with another
table by using the replace
method of the
mlreportgen.ppt.TemplateTable
object.
The mlreportgen.ppt.TemplateTable
class is a handle
class.
Class Attributes
HandleCompatible | true |
ConstructOnLoad | true |
For information on class attributes, see Class Attributes.
Creation
You do not create an mlreportgen.ppt.TemplateTable
object explicitly. When
you create a presentation from an existing presentation, the MATLAB® API for PowerPoint® (PPT API) creates an mlreportgen.ppt.TemplateTable
object for
each table that comes from a slide in the template presentation.
You can access the mlreportgen.ppt.TemplateTable
object for a template
table by using:
The
find
method of themlreportgen.ppt.Presentation
object.The
find
method of themlreportgen.ppt.Slide
object that corresponds to the slide that contains the template table.The
Children
property of themlreportgen.ppt.Slide
object that corresponds to the slide that contains the template table.
Note
Tables that you add to a new presentation are represented as mlreportgen.ppt.Table
objects.
Properties
XMLMarkup
— XML markup of template table
character vector | string scalar
XML markup of template table, specified as a character vector or string scalar. You
can modify the template table by changing the XML markup. Modify the XML markup for
customizations for which there is no property. The updated markup is written to the
generated presentation. If you update other properties, such as X
,
Y
, Width
, or Height
,
the corresponding attributes in the XML markup are updated before the markup is written
to the generated presentation.
Attributes:
NonCopyable | true |
Data Types: char
| string
Name
— Table name
character vector | string scalar
Table name, specified as a character vector or string scalar.
Attributes:
NonCopyable | true |
Data Types: char
| string
X
— Upper-left x-coordinate position
character vector | string scalar
Upper-left x-coordinate position, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, "5in" specifies five inches. Valid abbreviations are:
"px"
— pixels"cm"
— centimeters"in"
— inches"mm"
— millimeters"pc"
— picas"pt"
— points
Note
When the PPT API creates an mlreportgen.ppt.TemplateTable object, this property value is specified in English Metric Units (EMU). If you set this property, you must use one of the units in the previous list.
Attributes:
NonCopyable | true |
Data Types: char
| string
Y
— Upper-left y-coordinate position
character vector | string scalar
Upper-left y-coordinate position, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, "5in" specifies five inches. Valid abbreviations are:
"px"
— pixels"cm"
— centimeters"in"
— inches"mm"
— millimeters"pc"
— picas"pt"
— points
Note
When the PPT API creates an mlreportgen.ppt.TemplateTable object, this property value is specified in English Metric Units (EMU). If you set this property, you must use one of the units in the previous list.
Attributes:
NonCopyable | true |
Data Types: char
| string
Width
— Width of table
[]
(default) | character vector | string scalar
Width of table, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, '5in' specifies five inches. Valid abbreviations are:
"px"
— pixels"cm"
— centimeters"in"
— inches"mm"
— millimeters"pc"
— picas"pt"
— points
Note
When the PPT API creates an mlreportgen.ppt.TemplateTable object, this property value is specified in English Metric Units (EMU). If you set this property, you must use one of the units in the previous list.
Data Types: char
| string
Height
— Height of table
[]
(default) | character vector | string scalar
Height of table, specified as a character vector or string scalar that consists of a number followed by an abbreviation for a unit of measurement. For example, '5in' specifies five inches. Valid abbreviations are:
"px"
— pixels"cm"
— centimeters"in"
— inches"mm"
— millimeters"pc"
— picas"pt"
— points
Note
When the PPT API creates an mlreportgen.ppt.TemplateTable object, this property value is specified in English Metric Units (EMU). If you set this property, you must use one of the units in the previous list.
Data Types: char
| string
Style
— This property is ignored
not applicable
The class ignores this property.
Attributes:
NonCopyable | true |
Children
— This property is ignored
not applicable
The class ignores this property.
Attributes:
SetAccess | private |
NonCopyable | true |
Parent
— Parent of mlreportgen.ppt.TemplateTable
object
PPT API object
Parent of this object, specified as a PPT API object. A PPT API object must only have one parent.
Attributes:
SetAccess | private |
NonCopyable | true |
Id
— Object identifier for mlreportgen.ppt.TemplateTable
object
character vector | string scalar
Object identifier for the mlreportgen.ppt.TemplateTable
object, specified as a
character vector or string scalar. The PPT API generates a session-unique identifier
when it creates the document element object. You can specify your own value for
Id
.
Attributes:
NonCopyable | true |
Data Types: char
| string
Tag
— Tag for mlreportgen.ppt.TemplateTable
object
character vector | string scalar
Tag for the mlreportgen.ppt.TemplateTable
object, specified as a character vector or
string scalar. The PPT API generates a session-unique tag as part of the creation of
this object. The generated tag has the form
CLASS:ID
, where
CLASS
is the object class and
ID
is the value of the
Id
property of the object. Specify your own tag value to help
you identify where to look when an issue occurs during document generation.
Attributes:
NonCopyable | true |
Data Types: char
| string
Methods
Public Methods
replace | Replace template table with another table |
Examples
Modify and Replace Tables from a Template Presentation
Generate a presentation, MyTablePresentation
, that you then use as the template presentation for another presentation. MyTablePresentation
has two slides, and each slide has one table.
import mlreportgen.ppt.* ppt = Presentation("MyTablePresentation"); open(ppt); slide1 = add(ppt,"Title and Table"); replace(slide1,"Title","Magic Square Slide 1"); replace(slide1,"Table",Table(magic(3))); slide2 = add(ppt,"Title and Table"); replace(slide2,"Title","Magic Square Slide 2"); replace(slide2,"Table",Table(magic(5)));
Close and view MyTablePresentation
.
close(ppt); rptview(ppt);
Create a presentation, MyNewTablePresentation
, from MyTablePresentation
. MyTablePresentation
is the template presentation for MyNewTablePresentation
.
ppt = Presentation("MyNewTablePresentation","MyTablePresentation"); open(ppt);
Find the template tables by using the find
method of the slide objects. Because the tables come from the template presentation, find
returns the tables as mlreportgen.ppt.TemplateTable
objects.
slide1 = ppt.Children(1);
slide2 = ppt.Children(2);
templateTableObj1 = find(slide1,"Table")
templateTableObj1 = TemplateTable with properties: XMLMarkup: '<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id="3" name="Table"/><p:cNvGraphicFramePr><a:graphicFrameLocks noGrp="1"/></p:cNvGraphicFramePr><p:nvPr><p:ph idx="1" type="tbl"/></p:nvPr></p:nvGraphicFramePr><p:xfrm><a:off x="838200" y="1825625"/><a:ext cx="10515600" cy="4351338"/></p:xfrm><a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table"><a:tbl><a:tblPr bandRow="1" firstRow="1"/><a:tblGrid><a:gridCol w="3505200"/><a:gridCol w="3505200"/><a:gridCol w="3505200"/></a:tblGrid><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>8</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>1</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>6</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>3</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>5</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>7</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>4</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>9</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>2</a:t></a:r></a:p></a:txBody></a:tc></a:tr></a:tbl></a:graphicData></a:graphic></p:graphicFrame>' Name: 'Table' X: '838200emu' Y: '1825625emu' Width: '10515600emu' Height: '4351338emu' Style: [] Children: [] Parent: [1×1 mlreportgen.ppt.Slide] Tag: 'ppt.TemplateTable:1234:488' Id: '1234:488'
templateTableObj2 = find(slide2,"Table")
templateTableObj2 = TemplateTable with properties: XMLMarkup: '<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id="3" name="Table"/><p:cNvGraphicFramePr><a:graphicFrameLocks noGrp="1"/></p:cNvGraphicFramePr><p:nvPr><p:ph idx="1" type="tbl"/></p:nvPr></p:nvGraphicFramePr><p:xfrm><a:off x="838200" y="1825625"/><a:ext cx="10515600" cy="4351338"/></p:xfrm><a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table"><a:tbl><a:tblPr bandRow="1" firstRow="1"/><a:tblGrid><a:gridCol w="2103120"/><a:gridCol w="2103120"/><a:gridCol w="2103120"/><a:gridCol w="2103120"/><a:gridCol w="2103120"/></a:tblGrid><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>17</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>24</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>1</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>8</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>15</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>23</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>5</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>7</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>14</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>16</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>4</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>6</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>13</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>20</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>22</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>10</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>12</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>19</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>21</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>3</a:t></a:r></a:p></a:txBody></a:tc></a:tr><a:tr h="0"><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>11</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>18</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>25</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>2</a:t></a:r></a:p></a:txBody></a:tc><a:tc><a:txBody><a:bodyPr/><a:p><a:r><a:t>9</a:t></a:r></a:p></a:txBody></a:tc></a:tr></a:tbl></a:graphicData></a:graphic></p:graphicFrame>' Name: 'Table' X: '838200emu' Y: '1825625emu' Width: '10515600emu' Height: '4351338emu' Style: [] Children: [] Parent: [1×1 mlreportgen.ppt.Slide] Tag: 'ppt.TemplateTable:1238:490' Id: '1238:490'
Change the position of the table on the first slide.
templateTableObj1.X = "1in"; templateTableObj1.Y = "3in";
Replace the table on the second slide with a table for a 4-by-4 magic square.
replace(templateTableObj2,Table(magic(4)));
Close and view MyNewTablePresentation
.
close(ppt); rptview(ppt);
Version History
Introduced in R2019b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)