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:

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:

NonCopyable
true

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

ValueMarker DescriptionSupported Output Types
"circle"Open circleAll
"cjk-ideographic"

Plain ideographic numbers

Example: , , , ...

All
"decimal"

Decimal number

Example: 1, 2, 3, ...

All
"decimal-hierarchical"

Numbers that include the numbers of parent list levels.

Example:

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

Decimal number with leading zero

Example: 01, 02, 03, ...

All
"disc"Filled circleAll
"hiragana"

Hiragana numbering

Example: , , , ...

HTML, PDF
"hiragana-iroha"

Hiragana-iroha numbering

Example: , , , ...

HTML, PDF
"katakana"

Katakana numbering

Example: , , , ...

All
"katakana-iroha"

Katakana-iroha numbering

Example: , , , ...

All
"lower-alpha"

Lowercase alphabetic numbering

Example: a, b, c, ...

All
"lower-greek"

Lowercase Greek alphabetic numbering

Example: α, β, γ, ...

HTML, PDF
"lower-latin"

Lowercase Latin alphabetic numbering

Example: a, b, c, ...

All
"lower-roman"

Lowercase Roman numerals

Example: i, ii, iii, ...

All
"none"No markerAll
"upper-alpha"

Uppercase alphabetic numbering

Example: A, B, C, ...

All
"upper-latin"

Uppercase alphabetic numbering

Example: A, B, C, ...

All
"upper-roman"

Uppercase Roman numerals

Example: I, II, III, ...

All

Attributes:

NonCopyable
true

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

Note

This property is ignored for PDF template output.

Attributes:

NonCopyable
true

Data Types: char | string

Tag for mlreportgen.dom.TemplateUnorderedListLevelStyle 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

Object identifier for mlreportgen.dom.TemplateUnorderedListLevelStyle 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

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