Main Content

getTitleReporter

Class: mlreportgen.report.ListOfTables
Namespace: mlreportgen.report

Get list of tables title reporter

Since R2020b

Syntax

titleReporter = getTitleReporter(lot)

Description

titleReporter = getTitleReporter(lot) returns the mlreportgen.report.Title reporter that the specified mlreportgen.report.ListOfTables reporter uses to format the list of tables title. Use the properties of the returned Title reporter to customize the alignment, position, and appearance of the title.

Input Arguments

expand all

List of tables reporter, specified as an mlreportgen.report.ListOfTables object.

Output Arguments

expand all

List of tables reporter, returned as an mlreportgen.report.Title object.

Examples

expand all

Suppose that you defined a custom template for a list of tables title in the template library of a template for your report output type. To use the custom template:

  1. Get the title reporter using getTitleReporter.

  2. Set the properties of the title reporter. Set the Content property to the title text, the TemplateSrc property to the path and file name of the template file, and the TemplateName property to the name of the custom template for the list of tables title.

  3. Set the Title property of the list of tables reporter to the title reporter.

For this example, suppose that the template file myTemplate.pdftx defines two templates to use with a list of tables title. One template, ListOfTablesTitleRed, uses a style that makes the title red. The second template, ListOfTablesTitleBlue, uses a style that makes the title blue. This code applies the template that makes the title blue:

import mlreportgen.report.*
rpt = Report('myReport','pdf');
open(rpt);

lot = ListOfTables();
titleReporter = getTitleReporter(lot);
titleReporter.Content = "My List of Tables Title";
titleReporter.TemplateSrc = "myTemplate.pdftx";
titleReporter.TemplateName = "ListOfTablesTitleBlue";
lot.Title = titleReporter;
append(rpt,lot);
 
ch = Chapter("Magic Squares");
t = BaseTable(magic(2));
t.Title = "Order Two Magic Square";
append(ch,t);

append(rpt,ch);
close(rpt);
rptview(rpt);

Version History

Introduced in R2020b