Main Content



Get base table content hole reporter


reporter = getContentReporter(baseTable)


reporter = getContentReporter(baseTable) returns a hole reporter that the base table reporter uses to insert its content into a report. The default BaseTableContent template is in the template library of the BaseTable reporter. This template contains only a hole for the table generated from the Content property of the base table reporter. Use this method to customize the Content template to add a table to a report.

Input Arguments

expand all

Base table reporter object, specified as an object.

Output Arguments

expand all

Base table content hole reporter, returned as a reporter object.


Use Customized Table Content Template

Before you run this example, perform these steps.

  1. Use the method to create a copy of the template and name it 'myreporttemplate.pdftx'. Create the template in the same folder as the report.

  2. Use the method to create a copy of the BaseTable template in the report folder.

  3. Unzip the templates.

  4. Copy the BaseTableContent template from the BaseTable template library to the template library of myreporttemplate.pdftx.

  5. Copy the BaseTableContent style from the BaseTable style sheet to the myreporttemplate.pdftx style sheet.

  6. Edit the BaseTableContent template and style in the template library of myreporttemplate.pdftx to meet your requirements.

  7. Rezip the templates.

  8. Delete the copy of the BaseTable template.

import mlreportgen.dom.*
rpt = Report('myreport','pdf','myreporttemplate');
tableRptr = BaseTable();
tableRptr.Content = Table(magic(5));
contentRptr = getContentReporter(tableRptr);
contentRptr.TemplateSrc = rpt;
tableRptr.Content = contentRptr;

Version History

Introduced in R2017b