Main Content

slreportgen.finder.DataDictionaryResult class

Package: slreportgen.finder

Data dictionary search result object

Description

An object of the slreportgen.finder.DataDictionaryResult class represents a result of a search for data dictionaries. You can append a DataDictionaryResult object directly to a report. Alternatively, you can use the getReporter method to access the slreportgen.report.DataDictionary reporter for the result and then customize the reporter and append it to the report.

The slreportgen.finder.DataDictionaryResult class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

You do not create an slreportgen.finder.DataDictionaryResult object explicitly. The slreportgen.finder.DataDictionaryFinder find and next methods create an slreportgen.finder.DataDictionaryResult object for each data dictionary that is found.

Properties

expand all

Full path of the data dictionary represented by this result, specified as a string scalar. This property is read-only.

File name of data dictionary represented by this result, specified as a string scalar. This property is read-only.

Additional information to save with this result. You can set this property to any type of value.

Methods

expand all

Examples

collapse all

Use the getReporter method of an slreportgen.finder.DataDictionaryResult object to access the data dictionary reporter for the result. Then, customize the reporter by setting its properties.

Import the MATLAB and Simulink Report API packages so that you do not have to use long, fully qualified class names.

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

Create a Simulink report and add a table of contents.

rpt = slreportgen.report.Report("MyReport","html-file");
append(rpt,TableOfContents);

Create a dictionary finder that searches the entire MATLAB path. Find only data dictionaries with names that begin with sldemo_fuelysy_dd.

f = slreportgen.finder.DataDictionaryFinder();
f.Name = "sldemo_fuelsys_dd*";

Create a chapter with a section for each data dictionary result. For each result, customize the reporter to use a list for referenced dictionaries.

ch = Chapter("Data Dictionaries");
while hasNext(f)
    result = next(f);
    s = Section(result.Name);
    rptr = getReporter(result);
    rptr.ReferencedDictionaryPolicy = "List";
    append(s,rptr);
    append(ch,s);
end

Add the chapter to the report. Close and view the report.

append(rpt,ch);
close(rpt);
rptview(rpt);

The report has a section for each of the found dictionaries, sldemo_fuelsys_dd and sldemo_fuelsys_dd_controller. The sldemo_fuelsys_dd dictionary references two dictionaries, which are reported as a list. There is no Design Data Summary section for the sldemo_fuelsys_dd dictionary because all of its entries are owned by the referenced dictionaries.

Introduced in R2020b