Main Content

getTitleReporter

Class: mlreportgen.report.BaseTable
Namespace: mlreportgen.report

Get base table title reporter

Syntax

reporter = getTitleReporter(table)

Description

reporter = getTitleReporter(table) returns a reporter that the BaseTable reporter (table) uses to format the value specified by its Title property. Use getTitleReporter to customize the title alignment, position, and appearance.

Input Arguments

expand all

Table for the report, specified as a base table reporter object. To create the table input, use mlreportgen.report.BaseTable.

Output Arguments

expand all

Base table title reporter, returned as a reporter object.

Examples

Use Customized Table Title Style

Create a style for the title of your table that differs from the default style. First, create a custom BaseTable template using these steps:

  1. Create a copy of the PDF template of the reporter using the createTemplate method of the BaseTable reporter. Name the copy MyTableTemplate.pdftx and store it in the report folder.

  2. Unzip the template.

  3. Open the style sheet file of the template in a text editor.

  4. Edit the BaseTableTitle style in the style sheet file of the template so it meets your requirements.

  5. Save the style sheet file.

  6. Rezip the template.

Then, use the getTitleReporter method and the TemplateSrc property to use your template.

import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report('MyReport','pdf');
table = BaseTable();
table.Title = 'My Table';
titleReporter = getTitleReporter(table);
titleReporter.TemplateSrc = 'MyTableTemplate.pdftx';
table.Title = titleReporter;

Version History

Introduced in R2017b