User`s guide
Create and Format Lists
13-55
Create a Multilevel List
A multilevel list is an ordered or unordered list whose list items contain ordered or
unordered lists. You can create lists that have as many as nine levels.
You can create multilevel lists either from cell arrays or from scratch. Creating a
multilevel list from scratch is useful for creating list items that contain multiple
paragraphs, paragraphs and tables, and other combinations of document elements.
Create a Multilevel List from a Cell Array
You can use any of these approaches to create a multilevel list from a cell array.
• Nest one-dimensional cell arrays representing sublists in a one-dimension cell array
representing the parent list.
import mlreportgen.dom.*;
d = Document('orderedListReport','html');
ol = OrderedList({'step 1','step 2',...
{'option 1','option 2'},...
'step 3'});
append(d,ol);
close(d);
rptview('orderedListReport','html');
• Include list objects as members of a one-dimensional cell array representing the
parent list. Use this approach to create ordered sublists from cell arrays.
d = Document('myListReport','html');
append(d,{'first item',OrderedList({'step 1','step 2'}),'second item'});
close(d);
rptview('myListReport','html');
• Combine the nested cell array and nested list object approaches.
Create a Multilevel List from Scratch
You can create a multilevel list from scratch by appending child lists to parent lists.
import mlreportgen.dom.*;