Main Content

mlreportgen.ppt.TextOrientation Class

Namespace: mlreportgen.ppt

Orientation of text in a table entry

Since R2020a

Description

Use an mlreportgen.ppt.TextOrientation format object to specify the orientation of the text in a table entry in a PPT API presentation.

The mlreportgen.ppt.TextOrientation class is a handle class.

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

textOrientationObj = mlreportgen.ppt.TextOrientation sets the Value property to 'horizontal'.

textOrientationObj = mlreportgen.ppt.TextOrientation(orientation) sets the Value property to orientation.

example

Properties

expand all

Orientation of the table entry text, specified as a character vector or string scalar. Specify one of the values in the table.

ValueDescription
'horizontal'Text orientation is horizontal.
'down'Text orientation is vertical, with the content rotated 90 degrees, clockwise.
'up'Text orientation is vertical, with the content rotated 90 degrees, counterclockwise.

Object identifier for the mlreportgen.ppt.TextOrientation 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 for the mlreportgen.ppt.TextOrientation 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

Examples

collapse all

To specify the orientation of the text in a table entry in a presentation, add an mlreportgen.ppt.TextOrientation object to the Style property of the mlreportgen.ppt.TableEntry object that represents the table entry. This example generates a table with vertically oriented text in the first row.

Create a presentation.

import mlreportgen.ppt.*
ppt = Presentation("myTextOrientation.pptx");
open(ppt);

Add a slide to the presentation.

slide = add(ppt,"Title and Table");

Create a table.

t = Table({'Entry 11', 'Entry 12'; 'Entry 21', 'Entry 22'});
t.Height = '2in';
t.Width = '2in';
t.StyleName = "Medium style 2 - Accent 1";
t.Style = [t.Style {VAlign("middleCentered")}];

Specify the vertical text orientation for the entries in the first row.

tr1te1 = t.entry(1,1);
tr1te1.Style = [ tr1te1.Style {TextOrientation("down")} ];
tr1te2 = t.entry(1,2);
tr1te2.Style = [ tr1te2.Style {TextOrientation("down")} ];

Add a title and the table to the slide.

replace(slide,"Title","Row One Text Has Vertical Orientation");
replace(slide,"Table",t);

Close and view the presentation.

close(ppt);
rptview(ppt);

Here is the table in the generated presentation:

Version History

Introduced in R2020a