Package: mlreportgen.dom
Superclasses:
Automatically generated number
Automatically generated number for a DOM document element object.
creates
an automatically generated number without a specified number stream.autoObj
= AutoNumber()
creates
a number based on the specified numbering stream.autoObj
= AutoNumber(stream
)
creates
a number using the specified style.autoObj
= AutoNumber(stream
,styleName
)
stream
— Numbering stream for generating the numberSpecify a numbering stream, using the value of the mlreportgen.dom.AutoNumberStream
object StreamName
property.
If the specified stream does not exist, the DOM interface creates
an Arabic number stream having the specified name with an initial
value of 0. To use a stream with other properties, such as Roman numerals,
create a stream using mlreportgen.dom.Document.createAutoNumberStream
.
styleName
— Name of number style defined in the templateName of number style defined in the template, specified as a
character vector. The style specified by styleName
must
be defined in the template used to create the document to which the
number is appended.
autoObj
— Automatically created number objectmlreportgen.dom.AutoNumber
objectAutomatically created number object, specified as an mlreportgen.dom.AutoNumber
object.
BackgroundColor
— Background color[]
(default) | character vector | string scalarBackground color, specified as a character vector or string scalar that
consists of a CSS color name (see https://www.crockford.com/wrrrld/color.html) or a
hexadecimal RGB (truecolor) value in the form
#RRGGBB
.
Setting the BackgroundColor
property adds a corresponding
mlreportgen.dom.BackgroundColor
format object to the
Style
property. Setting the
BackgroundColor
property to an empty value
removes the object.
Example: 'blue'
Example: '#0000ff'
Bold
— Option to use bold for number[]
(default) | logical valueTo make text bold, set this property to true
or 1
.
If this property is empty and the StyleName
property
for this document element specifies a style sheet style, the weight
of the number is determined by that style. Setting the Bold
property
adds a corresponding mlreportGen.dom.Bold
format
object to the Style
property of this document element.
Removing the Bold
property setting removes the
object.
Data Types: logical
Color
— Text color[]
(default) | character vector | string scalarText color, specified as a character vector or string scalar that consists of
a CSS color name (see https://www.crockford.com/wrrrld/color.html) or a
hexadecimal RGB (truecolor) value in the form
#RRGGBB
.
Setting the Color
property adds a corresponding
mlreportgen.dom.Color
format object to the
Style
property. Setting the
Color
property to an empty value removes the
object.
Example: 'blue'
Example: '#0000ff'
CustomAttributes
— Custom attributes of document elementmlreportgen.dom.CustomAttribute
objectsCustom attributes of this document element, specified as an array of
mlreportgen.dom.CustomAttribute
objects. The custom attributes
must be supported by the output format.
FontFamilyName
— Name of font family for text[]
| character vector | string scalarName of a font family to use for text, specified as a character vector or string scalar.
Setting the FontFamilyName
property adds a corresponding
mlreportgen.dom.FontFamily
format object to the
Style
property. Setting the FontFamilyName
property is the same as setting the FontName
property of an
mlreportgen.dom.FontFamily
object. Setting the
FontFamilyName
property to an empty value removes the
object.
To specify substitutions for the font, do not specify the font family by setting this
property. Instead create and add an mlreportgen.dom.FontFamily
object
to the Style
property.
Example: 'Courier New'
FontSize
— Font sizeIf you need to specify substitutions for this font, do not set this property. Instead create
and add an
mlreportgen.dom.FontFamily
object to the Style
property of
this document element.
Setting the FontSize
property adds a corresponding mlreportGen.dom.FontSize
format
object to the Style
property for this document
element. Removing the FontSize
property setting
removes the object.
Font size, specified in the form valueUnits
,
where Units
is an abbreviation for the units. Use
one of these abbreviations for the units.
px
— pixels (default)
cm
— centimeters
in
— inches
mm
— millimeters
pc
— picas
pt
— points
Id
— ID for this document elementID 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.
Italic
— Option to use italics for a number[]
(default) | logical valueTo use italics for a number, set this property to true
.
If this property is empty and the StyleName
property
for this document element specifies a style sheet style, the slant
of the number is determined by that style. Setting the Italic
property
adds a corresponding mlreportGen.dom.Italic
format
object to the Style
property of this document element.
Removing the Italic
property setting removes the
object.
Data Types: logical
Strike
— Text strikethrough'none'
| 'single'
| 'double'
Text strikethrough, specified as one of these values:
'none'
— No strikethrough
'single'
— Single line
'double'
— Double line (for Word reports
only)
Setting the Strike
property adds a corresponding
mlreportgen.dom.Strike
format object to the
Style
property for this document element. Setting the
Strike
property to an empty value removes the object.
Style
— Formats that define the element styleThe formats specified by this property override corresponding
formats defined by the style sheet style specified by the StyleName
property
of this element. Formats that do not apply to this element are ignored.
StyleName
— Style for the numberThe style specified by styleName
must be
defined in the template used to create the document element to which
this number is appended.
Tag
— Tag for this document elementTag for this document element, specified as a character vector or string scalar.
The DOM 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. Specifying your own tag value can
help you to identify where an issue occurred during document generation.
Underline
— Type of underline[]
(default) | 'single'
| 'none'
| ...Type of underline, specified as one of the values in this table.
Underline value | Description | Supported Output Types |
---|---|---|
| Single line | All |
| Underline all characters except spaces | Word |
| Double line | Word |
| Thick line | Word |
| Dotted line | Word |
| Thick dotted line | Word |
| Dashed line | Word |
| Line with heavy dashes | Word |
| Line with long dashes | Word |
| Line with heavy long dashes | Word |
| Dot-dash line | Word |
| Heavy dash-dot line | Word |
| Dot-dot-dash line | Word |
| Line with heavy dashes with two dots between the dashes | Word |
| Wavy line | Word |
| Heavy wavy | Word |
| Double wavy line | Word |
| No underline | All |
Setting the Underline
property adds a corresponding
mlreportgen.dom.Underline
format object to the
Style
property. Setting the Underline
property
to an empty value removes the object.
To specify both the color and the type of the underline, do not set the
Underline
property. Instead, set the Style
property to include an mlreportgen.dom.Underline
format object that
specifies the underline type and color.
WhiteSpace
— How to treat white space in text[]
(default) | 'normal'
| 'nowrap'
| ...How to treat white space in text, specified as one of the values in this table.
Value | Description | Supported Output Types |
---|---|---|
| For HTML and PDF, this value removes spaces at the beginning and the end of text. Multiple spaces in the text collapse to a single space. For Word, this value removes spaces at the beginning and end of text. | All |
| Sequences of white space collapse into a single white space. Text never wraps to the next line. | HTML |
| Preserves white space. Text wraps only on line breaks. Acts
like the | HTML and PDF |
| Sequences of white space collapse into a single white space. Text wraps when necessary and on line breaks. | HTML and PDF |
| Preserves white space. Text wraps when necessary and on line breaks. | HTML and PDF |
| Same as 'pre'. | All |
Setting the WhiteSpace
property adds a corresponding
mlreportgen.dom.WhiteSpace
format object to the
Style
property. Setting the WhiteSpace
property to an empty value removes the object.
import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); p = Paragraph('Chapter '); p.Style = {CounterInc('chapter'),CounterReset('table'),... WhiteSpace('preserve')}; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p,AutoNumber('chapter')); append(p,'.'); append(p,AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve')}; append(d,p); p = Paragraph('Chapter '); p.Style = {CounterInc('chapter'),CounterReset('table'),... WhiteSpace('preserve')}; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p, AutoNumber('chapter')); append(p,'.'); append(p,AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve')}; append(d,p); close(d); rptview('test',doctype);
You have a modified version of this example. Do you want to open this example with your edits?