Main Content

slreportgen.report.SummaryTable Class

Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter

Summary table reporter for finder results

Since R2022a

Description

Use an object of slreportgen.report.SummaryTable class to summarize the search results obtained from a Simulink® model by using a Finder object.

Note

To use a Simulink summary table reporter in your report, you must create the report by using the slreportgen.report.Report class.

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

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

summaryTableRptr = slreportgen.report.SummaryTable creates a summary table for an unspecified set of finder results.

Note

Adding a Simulink summary table reporter with unspecified results to a report causes an error.

summaryTableRptr = slreportgen.report.SummaryTable(finderResults) creates a summary table reporter for the finder result objects in the array finderResults and sets the FinderResults property to 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 property to customize the set of properties to report on.

example

summaryTableRptr = slreportgen.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 slreportgen.report.FunctionReferenceResult, or slreportgen.report.SignalResult.

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' in the generated report.

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 this property is empty, the reporter determines which result object properties to report by using the getDefaultSummaryProperties method of the finder result objects specified in finderResults.

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

Whether to create a separate summary table for finder result objects based on the result object Type property, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) —

  • 0 (false) —

Attributes:

GetAccess
public
SetAccess
public

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

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

  • 0 (false) — Do link the Name property of each object in the summary table.

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 in the summary tables.

  • 0 (false) — Omit columns for empty finder result object properties in the summary tables.

Attributes:

GetAccess
public
SetAccess
public

Data Types: logical

Table reporter formatter type, specified as an mlreportgen.report.BaseTable object. The default value of this property is a BaseTable object with the TableStyleName property set to the SummaryTableTable style, which is defined in the default template for a SummaryTable reporter.

To customize the appearance of the summary table, customize the default reporter or replace 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 finder results representing named signals in your Simulink® model to a report.

Create a PDF report and load the required model

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

rpt = slreportgen.report.Report("SummaryTable","pdf");

% Open the model to report on
model_name = "sf_car";
load_system(model_name);

% Create a chapter for the Summary Table Reporter
titleStr = "Summary Table for Named Signals in "+model_name;
add(rpt,TitlePage(Title=titleStr,Author=""));

Create a SignalFinder object to find all the named signals in the model.

sigFinder = slreportgen.finder.SignalFinder(model_name);
sigFinder.IncludeInternalSignals = true;
sigFinder.IncludeUnnamedSignals = false;
results = find(sigFinder);

Create a summary table reporter for the results of the finder object.

reporter = slreportgen.report.SummaryTable(results);
reporter.Properties = ["Name","Source","DataType","Dimensions"];
reporter.Title = "Named Signals";
add(rpt,reporter);
close(rpt);
rptview(rpt);
close_system(model_name);

More About

expand all

Version History

Introduced in R2022a