mlreportgen.ppt.TablePlaceholder class

Package: mlreportgen.ppt
Superclasses:

Slide placeholder to replace with table

Description

Slide placeholder to replace with a table. You can create a table placeholder using a layout slide. In the default PPT API, when you add a Title and Table slide to a presentation, the API creates a TablePlaceholder object. Use the find method with the slide object to find the table placeholder. You can then set properties for the TablePlaceholder object.

Use the PowerPoint® editor to insert a picture placeholder in a presentation:

  1. Select the Slide Master tab.

  2. Click the layout slide you want to add the picture placeholder to. You can add the placeholder to an existing or a new layout slide.

  3. In the toolbar, click Insert Placeholder and select Table.

Properties

expand all

Table placeholder name, specified as a character vector.

Upper-left x-coordinate position of placeholder, specified

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Upper-left y-coordinate position of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Width of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Height of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Table placeholder formatting. This property is ignored.

Child elements of this object, specified as a cell array of PPT objects. This property is read-only.

Parent of this object, specified as a PPT object. This property is read-only.

ID for PPT API object, specified as a character vector. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

Tag for this PPT API object, specified as a character vector. 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 an issue occurred during presentation generation.

Methods

Method

Purpose

replace

Replace table placeholder with table.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myTablePlaceholderPresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Title and Table');

Create a table.

table1 = Table(magic(9));

The Title and Table layout includes an object named Table. Use the mlreportgen.ppt.Slide.find method to find an object with the Name property of Table.

contents = find(slide1,'Table');

Replace the table placeholder with the table.

replace(contents(1),table1);

Close the presentation to generate the output.

close(slides);

Open myTablePlaceholderPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

if ispc
    winopen(slidesFile);
end

Introduced in R2015b