Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getContentReporter

Class: mlreportgen.report.BaseTable
Package: mlreportgen.report

Get base table content hole reporter

Syntax

reporter = getContentReporter(baseTable)

Description

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 mlreportgen.report.BaseTable object.

Output Arguments

expand all

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

Examples

Use Customized Table Content Template

Before you run this example, perform these steps.

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

  2. Use the mlreportgen.report.BaseTable.createTemplate 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.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);

Introduced in R2017b

Was this topic helpful?