mlreportgen.dom.RowHeight class

Package: mlreportgen.dom
Superclasses:

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.

Construction

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.

Output Arguments

expand all

Row height, represented by an mlreportgen.dom.RowHeight object.

Properties

expand all

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

Tag for this 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.

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 (default)

  • 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');