mlreportgen.dom.TextOrientation class

Package: mlreportgen.dom
Superclasses:

Orientation of text in a table entry

Description

Specifies the orientation for text in a table entry.

Construction

textOrientationObj = TextOrientation() causes text to flow from left to right and for the first column to be on the left side of a table.

textOrientationObj = TextOrientation(orientation) causes text in a table entry to display with the specified orientation.

Input Arguments

expand all

Text orientation, specified as one of these values:

  • 'horizontal' — text is horizontal in the text entry

  • 'down' — text is vertical, with the first character at the top

  • 'up' — text is vertical, with the first character at the bottom

Output Arguments

expand all

Text orientation, returned as an mlreportgen.dom.TextOrientation object.

Properties

expand all

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for the document element, specified as a character vector.

The DOM generates a session-unique tag when it creates the document element. Structure the tag as class:id, where class is the class of the element and id is the value of the Id property. You can specify a tag to replace the generated tag. Specifying your own tag can make it easier to identify where an issue occurred during document generation.

Text orientation, specified as one of these values:

  • 'horizontal' — text is horizontal in the text entry

  • 'down' — text is vertical, with the first character at the top

  • 'up' — text is vertical, with the first character at the bottom

Table entry rotated text width, specified as a string. This property applies only to PDF output. The width string is specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Example: 10px

Data Types: string

Examples

collapse all

import mlreportgen.dom.*
d = Document('mydoc1','docx');

HeadStyle = {Bold,OuterMargin('0in')};
ch1 = Paragraph('Col1');
ch1.Style = HeadStyle;
ch2 = Paragraph('Col2');
ch2.Style = HeadStyle;

t = Table({ch1,ch2;'entry1','entry2'});
EntryStyle = {TextOrientation('down'),VAlign('middle')};
t.entry(1,1).Style = EntryStyle;
t.entry(1,2).Style = EntryStyle;
t.row(1).Style = {RowHeight('24pt','atleast')};
append(d,t);

close(d);
rptview(d.OutputPath);