mlreportgen.ppt.ColWidth class

Package: mlreportgen.ppt
Superclasses:

Table column width

Description

Width of a table column.

Construction

widthObj = ColWidth() creates a format object that specifies a column width of 0.25 inches.

widthObj = ColWidth(value) creates a column width object having the specified width.

Input Arguments

expand all

Width of column, specified in the form valueUnits, where Units is an abbreviation for the width units. These abbreviations are valid:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Output Arguments

expand all

Column width, returned as an mlreportgen.ppt.ColWidth object.

Properties

expand all

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

Width of column, specified in the form valueUnits, where Units is an abbreviation for the width units. These abbreviations are valid:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myColWidth.pptx'
slides = Presentation(slidesFile);
slide1 = add(slides,'Title and Content');

Create a table and specify that the first column has a width of four inches.

C = {'wide column' 17 'aaaa' 4 5 6 7 8 9 10 11;...
    'long text string' 'bb' 1 3 5 7 9 11 13 15 17;...
    'more text' 1 2 3 4 5 6 7 8 9 10};

t = Table(C);
t.entry(1,1).Style = {ColWidth('4in')};

Replace the slide content with the table, generate the presentation, and open the myColWidth presentation. (The winopen code works on Windows® platforms.)

replace(slide1,'Content',t);
close(slides); 

if ispc
    winopen(slidesFile);
end