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.createTemplatemethod to create a copy of themlreportgen.report.Reporttemplate and name it"myreporttemplate.pdftx". Create the template in the same folder as the report.Use the
mlreportgen.report.BaseTable.createTemplatemethod to create a copy of theBaseTabletemplate in the report folder.Unzip the templates.
Copy the
BaseTableContenttemplate from theBaseTabletemplate library to the template library ofmyreporttemplate.pdftx.Copy the
BaseTableContentstyle from theBaseTablestyle sheet to themyreporttemplate.pdftxstyle sheet.Edit the
BaseTableContenttemplate and style in the template library ofmyreporttemplate.pdftxto meet your requirements.Rezip the templates.
Delete the copy of the
BaseTabletemplate.
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