Main Content

mlreportgen.dom.RowHeight Class

Namespace: mlreportgen.dom

Height of table row

Description

Specifies the height of a table row.

This format object enables you to specify an exact (fixed) row height in Microsoft® Word output. If the row content does not fit in the specified height, Word truncates the content to preserve the specified height. For PDF and HTML output, the behavior of the mlreportgen.dom.RowHeight format object is the same as the behavior of the mlreportgen.dom.Height format object. With both format objects, PDF and HTML documents treat the specified height as a minimum to be adjusted upward to accommodate content. If you do not need to specify an exact height, you can use either RowHeight or Height to specify the height.

The mlreportgen.dom.RowHeight class is a handle class.

Creation

Description

rowHeightObj = RowHeight specifies a row that is exactly one inch high.

rowHeightObj = RowHeight(height) sets a row to exactly the specified height.

rowHeightObj = RowHeight(height,heightType) sets a row to be exactly the specified height or at least the specified height, depending on the value of heightType.

example

Properties

expand all

Object identifier for the mlreportgen.dom.RowHeight object, specified as a character vector or string scalar. The DOM 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.dom.RowHeight object, specified as a character vector or string scalar. The DOM 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

Type of row height measurement, specified as one of these values:

  • 'exact'Microsoft Word generates a row of the specified height and truncates content that does not fit. HTML and PDF viewers create a row of at least the specified height and adjust the row height to accommodate the content.

  • 'atleast — Word, HTML and PDF viewers create a row of at least the specified height and adjust the row height to accommodate the content

Height of table row in the form valueUnits, where Units is an abbreviation for the units. These abbreviations are valid:

  • "px" — pixels

  • "cm" — centimeters

  • "in" — inches

  • "mm" — millimeters

  • "pc" — picas

  • "pt" — points

Examples

collapse all

Create a table with two rows. The first row has at least the specified height and the second has a fixed maximum height.

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

t = Table(2);
t.Style = {Border('solid'),RowSep('solid'),ColSep('solid')};
t.Width = '1in';
r1 = TableRow();
r1.Style = {RowHeight('.25in','atleast')};
append(r1,TableEntry(...
    'This row can expand beyond .25 inches'));
append(r1,TableEntry('x'));

r2 = TableRow();
r2.Style = {RowHeight('.25in','exact')};
append(r2,TableEntry...
    ('Truncated text because height is fixed'));
append(r2,TableEntry('x'));

append(t,r1);
append(t,r2);
append(d,t);

close(d);
rptview('myTableDoc','docx');

Version History

Introduced in R2014b