Contenuto principale

mlreportgen.report.SummaryTable Class

Namespace: mlreportgen.report
Superclasses: mlreportgen.report.Reporter

Summarize finder results

Since R2022a

Description

Use an instance of mlreportgen.report.SummaryTable class to generate a table that summarizes the results of a search by a MATLAB® Report Generator™ finder object. The table lists the key properties of each finder result object. For more information, see finder result class.

The mlreportgen.report.SummaryTable class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

summaryTableRptr = mlreportgen.report.SummaryTable creates an empty summary table reporter. Use the FinderResults property to specify the results to summarize.

Note

Adding an empty MATLAB summary table reporter to a report causes an error.

summaryTableRptr = mlreportgen.report.SummaryTable(finderResults) creates a summary table reporter for the result objects in the array finderResults and sets the FinderResults property to finderResults.

example

summaryTableRptr = mlreportgen.report.SummaryTable(Name=Value) sets properties by using name-value arguments. Specify multiple name-value arguments in any order.

Properties

expand all

Finder result objects to report, specified as an array of objects of a finder result class such as mlreportgen.finder.MATLABVariableResult or mlreportgen.finder.AxesResult.

Attributes:

GetAccess
public
SetAccess
public

Title for the summary table, specified as a string, character vector, or a DOM object. By default, this property is empty and the reporter creates the table title by using the getDefaultSummaryTableTitle method for the finder result object specified by finderResults.

Specifying this property as a character vector or string scalar creates an mlreportgen.dom.Paragraph object with Style property set to "SummaryTableTitleParagraph".

Attributes:

GetAccess
public
SetAccess
public

Properties of the result class to report on, specified as an array of string scalars or cell array of character vectors.

If Properties is empty, the reporter determines which finder result object properties to report by using the getDefaultSummaryProperties method of the finder result object specified by finderResults.

The summary table contains a row for each result whose entries contain properties of the found object. By default, the reported properties depend on the result object type. Use the summary table reporters Properties properties to customize the set of properties to report on.

Use the getPropertyValues method of the finder result object specified by finderResults to identify the properties you can add to the summary table.

Attributes:

GetAccess
public
SetAccess
public

Data Types: cell

Whether to link the Title property of each object in the summary table to the corresponding reporter object, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — Link the Title property of each object in the summary table to the corresponding reporter object.

  • 0 (false) — Do not link the Title property of each object in the summary table to the corresponding reporter object.

Attributes:

GetAccess
public
SetAccess
public

Data Types: logical

Whether to include columns for empty finder result object properties in the summary tables, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — Include columns for empty finder result object properties.

  • 0 (false) — Omit columns for empty finder result object properties.

Attributes:

GetAccess
public
SetAccess
public

Data Types: logical

Table reporter formatter type, specified as an mlreportgen.report.BaseTable object. Customize the appearance of the summary table by customizing the default reporter or by replacing it with a customized BaseTable reporter.

Attributes:

GetAccess
public
SetAccess
public

Source of the template for this reporter, specified in one of these ways:

  • Character vector or string scalar that specifies the path of the file that contains the template for this reporter

  • Reporter or report whose template this reporter uses or whose template library contains the template for this reporter

  • Document Object Model (DOM) document or document part whose template this reporter uses or whose template library contains the template for this reporter

The specified template must be the same type as the report to which you append this reporter. For example, for a Microsoft® Word report, TemplateSrc must be a Word reporter template. If the TemplateSrc property is empty, this reporter uses the default reporter template for the output type of the report.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true
Dependent
true

Name of the template for this reporter, specified as a character vector or string scalar. The template for this reporter must be in the template library of the template specified by the TemplateSrc property of this reporter.

Attributes:

GetAccess
public
SetAccess
public

Data Types: char | string

Hyperlink target for this reporter, specified as a character vector or string scalar that specifies the link target ID, or an mlreportgen.dom.LinkTarget object. A character vector or string scalar value converts to a LinkTarget object. The link target immediately precedes the content of this reporter in the output report.

Attributes:

GetAccess
public
SetAccess
public

Methods

expand all

Examples

collapse all

This example shows how to add a summary table for the results of an mlreportgen.finder.AxesFinder object.

Create a PDF report.

import mlreportgen.report.*
import mlreportgen.finder.*

rpt = mlreportgen.report.Report("Summary Table Results","pdf");
add(rpt,TitlePage("Title",sprintf("Summary Table for Axes Finder Results"),"Author",""));

Create a figure handle and the axes to report.

figH = figure;
ax1 = subplot(3,2,2);
x = linspace(0,20);
y1 = cos(x);
plot(x,y1);
ax1.Title = title("Example Plot 1");

ax2 = subplot(3,2,4);
y2 = sin(tan(x).*x);
plot(x,y2);
ax2.Title = title("Example Plot 2");

Create an AxesFinder object to find the axes.

finderObj = mlreportgen.finder.AxesFinder(figH);
results = find(finderObj);

Pass the results of the find method to a SummaryTable reporter.

rptr = mlreportgen.report.SummaryTable(results);
rptr.ShowEmptyColumns = true;
append(rpt,rptr);
close(rpt);
rptview(rpt);

More About

expand all

Version History

Introduced in R2022a