getContentReporter
Class: mlreportgen.report.BaseTable
Namespace: mlreportgen.report
Get base table content hole reporter
Syntax
reporter = getContentReporter(baseTable)
Description
returns a hole reporter that the base table reporter uses to insert its content into a
report. The default reporter
= getContentReporter(baseTable
)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
Output Arguments
Examples
Use Customized Table Content Template
Before you run this example, perform these steps.
Use the
mlreportgen.report.Report.createTemplate
method to create a copy of themlreportgen.report.Report
template and name it'myreporttemplate.pdftx'
. Create the template in the same folder as the report.Use the
mlreportgen.report.BaseTable.createTemplate
method to create a copy of theBaseTable
template in the report folder.Unzip the templates.
Copy the
BaseTableContent
template from theBaseTable
template library to the template library ofmyreporttemplate.pdftx
.Copy the
BaseTableContent
style from theBaseTable
style sheet to themyreporttemplate.pdftx
style sheet.Edit the
BaseTableContent
template and style in the template library ofmyreporttemplate.pdftx
to meet your requirements.Rezip the templates.
Delete the copy of the
BaseTable
template.
import mlreportgen.report.* import mlreportgen.dom.* rpt = Report('myreport','pdf','myreporttemplate'); tableRptr = BaseTable(); tableRptr.Content = Table(magic(5)); contentRptr = getContentReporter(tableRptr); contentRptr.TemplateSrc = rpt; tableRptr.Content = contentRptr; add(rpt,tableRptr); close(rpt);
Version History
Introduced in R2017b