Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.dom.OutlineLevel class

Package: mlreportgen.dom
Superclasses:

Level of paragraph in outline

Description

Specifies the level of a paragraph in an automatically generated outline. This class is intended for Microsoft® Word reports, because HTML does not support displaying paragraphs in a table of contents.

Construction

outlineLevelObj = OutlineLevel() sets the outline level of this paragraph to 1. This causes the content of the paragraph to appear at the top level in an automatically generated outline (for example, a table of contents).

outlineLevelObj = OutlineLevel(level) sets the paragraph to the specified outline level.

Input Arguments

expand all

Outline level for a paragraph, specified as a positive integer, from 1 to 9.

Data Types: int16

Output Arguments

expand all

Level of paragraph in outline, represented by an mlreportgen.dom.OutlineLevel object.

Properties

expand all

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

Tag for document element, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

Outline level for a paragraph, specified as a positive integer, from 1 to 9.

Data Types: int16

Examples

expand all

Add an automatically generated table of contents and set the outline level of the “Glossary” paragraph so that the paragraph appears at the top level of the table of contents. This example uses the default DOM Word template.

Create a document and document part for the table of contents. The document part uses the ReportTOC building block from the default DOM Word template.

import mlreportgen.dom.*
d = Document('tocDoc','docx');
open(d);

dp = DocumentPart(d,'ReportTOC');
append(d,dp);

Set the OutlineLevel property internally, so that there are four levels in the table of contents.

for i = 1:4
    % set internally the OutlineLevel property
    append(d,Heading(i,'My Chapter'));
    append(d,Paragraph('chapter content....'));
end

Use OutlineLevel to set the level of the Glossary paragraph to 1, so that the paragraph appears at the top level of the table of contents. Display the report.

para = append(d,Paragraph('Glossary'));
para.Style = {OutlineLevel(1)};

close(d);
rptview(d.OutputPath,d.Type);
Was this topic helpful?