Main Content

getTitleReporter

Class: mlreportgen.report.TableOfContents
Namespace: mlreportgen.report

Get table of contents title reporter

Syntax

reporter = getTitleReporter(toc)

Description

reporter = getTitleReporter(toc) returns a reporter that the TableOfContents reporter uses to format the content specified in its Title property. Use this reporter to customize the alignment, position, and appearance of the title.

Input Arguments

expand all

Table of contents of the report, specified as a reporter object. To create the toc input, you use mlreportgen.report.TableOfContents.

Output Arguments

expand all

Table of contents title reporter, returned as a reporter object.

Examples

Use Nondefault Table of Contents Title Style

Assume that you want a style for your table of contents title that differs from the default. Before you run this example, create a template file named MyTOCTemplate and customize its TableOfContentsTitle style. Then, use the getTitleReporter method and the TemplateSrc property to use your template.

import mlreportgen.report.*
rpt = Report();
toc = TableOfContents();
toc.Title = 'Report Contents'
toc.Title = getTitleReporter(toc);
toc.Title.TemplateSrc = 'MyTOCTemplate';
add(rpt,toc)

Version History

Introduced in R2017b