slreportgen.report.DataDictionary Class
Namespace: slreportgen.report
Superclasses: slreportgen.report.Reporter
Description
Use an object of the slreportgen.report.DataDictionary
class to report on a
Simulink® data dictionary. Create a DataDictionary
object to report on a
specific data dictionary. Alternatively, use an
slreportgen.finder.DataDictionaryFinder
object to find data dictionaries and
use the getReporter
method of an
slreportgen.finder.DataDictionaryResult
object to return the reporter for the
result.
Note
To use an slreportgen.report.DataDictionary
reporter in a report, you
must create the report using the slreportgen.report.Report
class or
subclass.
The slreportgen.report.DataDictionary
class is a handle
class.
Creation
Description
creates a reporter
= slreportgen.report.DataDictionaryDataDictionary
reporter object based on the default template. Use
the reporter properties to specify a data dictionary and report options. You must specify
the data dictionary to report. Adding an empty data dictionary reporter object to a report
produces an error.
creates a reporter
= slreportgen.report.DataDictionary(dictionaryName
)DataDictionary
reporter object and sets the Dictionary
property to the specified data dictionary. Use the reporter properties to specify report
options.
sets the reporter properties using name-value pairs. You can specify multiple name-value
pair arguments in any order.reporter
= slreportgen.report.DataDictionary(Name=Value
)
Properties
Dictionary
— Data dictionary to report
character vector | string scalar
Data dictionary to report, specified as a character vector or string scalar that contains the file name of a dictionary on the MATLAB® path or the path and file name of a data dictionary. The path can be relative or absolute.
Example: "sldemo_fuelsys_dd.sldd"
Example: "myDictionaries/myDataDictionary.sldd"
Attributes:
GetAccess | public |
SetAccess | public |
SummaryProperties
— Properties to report
["Name" "Value" "Class" "LastModified" "LastModifiedBy"
"Status" "DataSource"]
(default) | string array | cell array of character vectors
Properties to report for each data dictionary entry in the summaries table, specified as a string array or cell array of character vectors. Valid properties are:
Name
Value
Class
LastModified
LastModifiedBy
Status
DataSource
The Value
entry contains the value if the data type is numeric
scalar, logical scalar, string scalar, or character vector. Otherwise, the
Value
entry is See details.
Example: ["Name" "Value" "Class" "LastModified" "LastModifiedBy" "Status"
"DataSource"]
Example: {'Name' 'Value' 'Class'}
Attributes:
GetAccess | public |
SetAccess | public |
ShowDesignData
— Whether to report Design Data section
true
(default) | false
Whether to report the Design Data section of the data
dictionary, specified as true
or false
.
Attributes:
GetAccess | public |
SetAccess | public |
Data Types: logical
ShowConfigurations
— Whether to report Configurations section
false
(default) | true
Whether to report the Configurations section of the data
dictionary, specified as true
or false
.
Attributes:
GetAccess | public |
SetAccess | public |
Data Types: logical
ShowOtherData
— Whether to report Other Data section
false
(default) | true
Whether to report the Other Data section of the data
dictionary, specified as true
or false
.
Attributes:
GetAccess | public |
SetAccess | public |
Data Types: logical
IncludeReferencedDictionaries
— Whether to include referenced dictionaries
true
(default) | false
Whether to include the dictionaries that are referenced by the dictionary that this
reporter reports, specified as true
or false
. The
ReferencedDictionaryPolicy
property determines how referenced
dictionaries are reported.
Attributes:
GetAccess | public |
SetAccess | public |
Data Types: logical
ReferencedDictionaryPolicy
— Display policy for referenced dictionary
"SameTable"
(default) | character vector | string scalar
Display policy for reporting a referenced dictionary, specified as one of these values:
"SameTable"
— Report referenced dictionary entries in the same table as the main dictionary entries. The details are displayed in the order that they appear in the summary table. This value is the default value."SeparateTables"
— Make a separate table for each referenced dictionary. The referenced dictionary summary tables are displayed immediately after the main summary table. The referenced dictionary details reporters are displayed after the main dictionary details reporters."List"
— Report a list of referenced dictionaries. The list items link to separate data dictionary reporters. The links work only if you add the reporters for the referenced dictionaries to this report. The list appears in the Design Data section, immediately after the dictionary summary table. The dictionary summary table does not include the referenced dictionary entries. The details are not reported for the referenced dictionary entries.
Attributes:
GetAccess | public |
SetAccess | public |
EntryFilterFcn
— Data dictionary entry filter
[]
(default) | function handle | string scalar | character vector
Data dictionary entry filter, specified as a function handle, string scalar, or
character vector. If you do not provide EntryFilterFcn
, all entries
are included in the report.
If you provide a function handle, the associated function must:
Take these arguments:
entryObject
— TheSimulink.data.dictionary.Entry
objectentryValue
— Value of theSimulink.data.dictionary.Entry
object
Return
true
to filter the specified entry from the report, orfalse
to include the entry in the report.
Run the following command to access the supporting files used in this example.
openExample('rptgenext/SimulinkReportGeneratorFilesExample');
For example, this code uses the EntryFilterFcn
property to
prevent reporting of entries that are Simulink.Parameter
objects:
rpt = slreportgen.report.Report("MyReport","pdf"); ddPath = which("slrgex_fuelsys.sldd"); ch = mlreportgen.report.Chapter("slrgex_fuelsys.sldd"); rptr = slreportgen.report.DataDictionary(ddPath); filterFcnHandle = @(entryObject, entryValue) ... isa(entryValue,"Simulink.Parameter"); rptr.EntryFilterFcn = filterFcnHandle; append(ch,rptr); append(rpt,ch); close(rpt); rptview(rpt);
If you provide a string scalar or a character vector, it must contain an expression. The expression:
Can use the variables
entryObject
andentryValue
Must set the variable
isFiltered
totrue
to filter the specified entry from the report, orfalse
to include the entry in the report
For example, this code uses the EntryFilterFcn
property to
prevent reporting of entries that are Simulink.Bus
objects:
rpt = slreportgen.report.Report("MyReport","pdf"); ddPath = which("slrgex_fuelsys.sldd"); ch = mlreportgen.report.Chapter("slrgex_fuelsys.sldd"); rptr = slreportgen.report.DataDictionary(ddPath); filterStr = "isFiltered = isa(entryValue,'Simulink.Bus');"; rptr.EntryFilterFcn = filterStr; append(ch,rptr); append(rpt,ch); close(rpt); rptview(rpt);
Attributes:
GetAccess | public |
SetAccess | public |
SummaryTableReporter
— Formatter for entry summary tables
mlreportgen.report.BaseTable
object
Formatter for the entry summary tables, specified as an mlreportgen.report.BaseTable
object. The default value of this property is a
BaseTable
object with the TableStyleName
property
set to the DataDictionaryTable
style which is defined in the default
template for a DataDictionary
reporter. To customize the appearance of
the table, modify the properties of the default BaseTable
object or
replace the object with a customized BaseTable
reporter. If you add
content to the Title
property, the content appears in front of the
table title in the generated report.
Attributes:
GetAccess | public |
SetAccess | public |
DetailsReporter
— Formatter for reporting design data and other data entry details
mlreportgen.report.MATLABVariable
object
Formatter for reporting the details of the entry values in the Design
Data and Other Data sections of the data dictionary,
specified as an mlreportgen.report.MATLABVariable
object. The default value of this property
is a MATLABVariable
object with default property values. To customize the
appearance of the entry details, modify the properties of the default
MATLABVariable
object or replace the object with your own
MATLABVariable
reporter. The Variable
,
Location
, and LinkTarget
properties of the
MATLABVariable
reporter are ignored.
Attributes:
GetAccess | public |
SetAccess | public |
ConfigurationReporter
— Formatter for reporting configuration entry details
slreportgen.report.ModelConfiguration
object
Formatter for reporting the details about the entry values in the
Configurations section of a data dictionary, specified as an
slreportgen.report.ModelConfiguration
object. The default value of this
property is a ModelConfiguration
object with default property values. To
customize the appearance of the entry details, modify the properties of the default
object or replace it with your own ModelConfiguration
object. The
Model
and LinkTarget
properties of the
reporter are ignored.
Attributes:
GetAccess | public |
SetAccess | public |
ListFormatter
— List formatter for referenced dictionary list
mlreportgen.dom.UnorderedList
object | mlreportgen.dom.OrderedList
object
List formatter for a referenced dictionary list, specified as an mlreportgen.dom.UnorderedList
object or mlreportgen.dom.OrderedList
object. The list formatter is used when the
ReferencedDictionaryPolicy
property is set to
"List"
. The UnorderedList
or
OrderedList
object must not contain list items.
The default value of this property is an UnorderedList
object with
the StyleName
property set to the
DataDictionaryList
style, which is defined in the default template
of a DataDictionary
reporter. To customize the appearance of the list,
modify the properties of the default UnorderedList
object or replace the
object with your own UnorderedList
or OrderedList
object.
Attributes:
GetAccess | public |
SetAccess | public |
TemplateSrc
— Source of template for reporter
[]
(default) | character vector | string scalar | reporter or report | DOM document or document part
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 is used for this reporter or whose template library contains the template for this reporter
DOM document or document part whose template is used for this reporter 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 report. 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.
TemplateName
— Name of template for this reporter
character vector | string scalar
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.
Data Types: char
| string
LinkTarget
— Hyperlink target for this reporter
[]
(default) | character vector | string scalar | mlreportgen.dom.LinkTarget
object
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.
Methods
Public Methods
slreportgen.report.DataDictionary.createTemplate | Copy the default slreportgen.report.DataDictionary reporter
template |
slreportgen.report.DataDictionary.customizeReporter | Create subclass of slreportgen.report.DataDictionary
class |
slreportgen.report.DataDictionary.getClassFolder | Get location of folder that contains the
slreportgen.report.DataDictionary class definition file |
copy | Create copy of a Simulink reporter object and make deep copies of certain property values |
getImpl | Get implementation of reporter |
Examples
Report on Data Dictionary
Use an object of the slreportgen.report.DataDictionary
class to report on a Simulink data dictionary.
Import the MATLAB Report and Simulink Report API namespaces so that you do not have to use long, fully qualified class names.
import slreportgen.report.* import mlreportgen.report.*
Create a Simulink report.
rpt = slreportgen.report.Report("MyReport","pdf");
Specify the path of the data dictionary used by the model slrgex_fuelsys
.
ddPath = which("slrgex_fuelsys.sldd");
Create a chapter for the data dictionary information.
ch = Chapter("slrgex_fuelsys.sldd");
Create a reporter for the data dictionary.
rptr = DataDictionary(ddPath);
Append the reporter to the chapter and the chapter to the report.
append(ch,rptr); append(rpt,ch);
Close and view the report.
close(rpt); rptview(rpt);
Version History
Introduced in R2020b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)