Main Content

mlreportgen.dom.TemplateUnorderedListLevelStyle Class

Namespace: mlreportgen.dom

Style formats for a specific list level in a TemplateUnorderedListStyle object

Since R2024a

Description

This class represents a level of an unordered list style. Creating an mlreportgen.dom.TemplateUnorderedListLevelStyle object populates the object's Levels property with instances of this class. Use the LevelStyles property to format the unordered list's levels.

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

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Properties

expand all

List level that this object formats, specified as an integer.

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

Data Types: double

Style sheet formats, specified as an array of DOM formatting objects. These formats define how this style affects report content.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Style of bullet used for this list level, specified as one of these values.

ValueMarker DescriptionSupported in Microsoft® WordSupported in HTML and PDF
"circle"Open circleyesyes
"cjk-ideographic"

Plain ideographic numbers

Example: , , , ...

yesyes
"decimal"

Decimal number

Example: 1, 2, 3, ...

yesyes
"decimal-hierarchical"

Numbers that include the numbers of parent list levels.

Example:

1.
    1.1
    1.2
        1.2.1
        1.2.2
2.
yesno
"decimal-leading-zero"

Decimal number with leading zero

Example: 01, 02, 03, ...

yesyes
"disc"Filled circleyesyes
"hiragana"

Hiragana numbering

Example: , , , ...

noyes
"hiragana-iroha"

Hiragana-iroha numbering

Example: , , , ...

noyes
"katakana"

Katakana numbering

Example: , , , ...

yesyes
"katakana-iroha"

Katakana-iroha numbering

Example: , , , ...

yesyes
"lower-alpha"

Lowercase alphabetic numbering

Example: a, b, c, ...

yesyes
"lower-greek"

Lowercase Greek alphabetic numbering

Example: α, β, γ, ...

noyes
"lower-latin"

Lowercase Latin alphabetic numbering

Example: a, b, c, ...

yesyes
"lower-roman"

Lowercase Roman numerals

Example: i, ii, iii, ...

yesyes
"none"No markeryesyes
"upper-alpha"

Uppercase alphabetic numbering

Example: A, B, C, ...

yesyes
"upper-latin"

Uppercase alphabetic numbering

Example: A, B, C, ...

yesyes
"upper-roman"

Uppercase Roman numerals

Example: I, II, III, ...

yesyes

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Formats that are applied to only the list bullets for this level, specified as an array of DOM formatting objects.

Note

The PDF template output ignores this property.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Tag, 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. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Examples

collapse all

Create a multilevel unordered list style in a template and then apply that style in your document.

Create the Style in the Template

Import the DOM API namespace so that you do not have to use long, fully qualified names.

import mlreportgen.dom.*;
t = Template("myTemplate","pdf");
open(t);

Create a list style.

listStyle = TemplateUnorderedListStyle("myUnorderedListStyle");

Define formats for level 1.

level1Style = listStyle.LevelStyles(1);
level1Style.Formats = [Color("blue"), FontSize("32pt")];

Define formats for level 2.

level2Style = listStyle.LevelStyles(2);
level2Style.Formats = [Color("red"), FontSize("16pt")];

Add style to the stylesheet.

addStyle(t.Stylesheet,listStyle);

Close the template.

close(t);

Use the Style from the Template in a Document

Create a document using the generated template.

d = Document("myDoc","pdf","myTemplate");
open(d);

Create a list object with 2 levels.

list = UnorderedList(["first level item 1", "first level item 2"]);
secondLevelList = UnorderedList(["second level item 1", "second level item 2"]);
append(list, secondLevelList);

Set the style name.

list.StyleName = "myUnorderedListStyle";

Add the list to the document.

append(d,list);

Close and view the document.

close(d);
rptview(d);

Version History

Introduced in R2024a