mlreportgen.ppt.TemplateTable Class
Namespace: mlreportgen.ppt
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
XML markup of template table, specified as a character vector. 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.
Name
— Table name
character vector | string scalar
Table name, specified as a character vector or string scalar.
X
— Upper left x-coordinate of position of table
[]
(default) | character vector | string scalar
Upper left x-coordinate of the position of the table, specified as a character vector or string scalar that consists of a number followed by a unit of measurement. For example, '5in' specifies 5 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
Y
— Upper left y-coordinate of position of table
[]
(default) | character vector | string scalar
Upper left y-coordinate of the position of the table, specified as a character vector or string scalar that consists of a number followed by a unit of measurement. For example, '5in' specifies 5 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
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
— Template table formatting
[]
(default)
The class ignores this property.
Children
— Children of this PPT API object
[]
This read-only property is empty.
Parent
— Parent of this PPT API object
PPT object
Parent of this object, specified as a PPT object.
Attributes:
SetAccess | private |
NonCopyable | true |
Id
— ID for this PPT API object
character vector | string scalar
ID for this PPT API object, specified as a character vector or string scalar. A session-unique ID is generated as part of the object creation. You can specify an ID to replace the generated ID.
Attributes:
NonCopyable | true |
Data Types: char
| string
Tag
— Tag for this PPT API object
character vector | string scalar
Tag for this PPT API object, specified as a character vector or string scalar. A session-unique tag is generated 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.
Specifying your own tag value can help you to identify where issues occur during presentation 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 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)