Main Content

mlreportgen.dom.ExternalLink class

Package: mlreportgen.dom

Hyperlink to a location outside of document

Description

Defines a hyperlink to a location outside of the document.

The mlreportgen.dom.ExternalLink class is a handle class.

Creation

Description

externalLinkObj = ExternalLink(target,linkText) creates a hyperlink to the specified target and having the specified link text. This constructor creates a text object (mlreportgen.dom.Text) to hold the link text.

externalLinkObj = ExternalLink(target,linkText,linkTextStyleName) creates a hyperlink with the specified link text and style name.

example

externalLinkObj = ExternalLink(target,textObj) creates a hyperlink to the specified target using the specified Text object.

Input Arguments

expand all

The link target of the external link, specified as either a character vector (for a URL) or as an mlreportgen.dom.LinkTarget object.

The text to use for the link text.

Name of style to use for the link text.

Text object containing link text, specified by an mlreportgen.dom.Text object.

Properties

expand all

Custom attributes of this document element, specified as an array of mlreportgen.dom.CustomAttribute objects. The custom attributes must be supported by the output format.

ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Format objects that specify the format of a document element.

Name of link style defined in the template, specified as a character vector. The style specified by styleName must be defined in the template used to create the document to which the link is appended.

Tag for this document element, specified as a character vector or string scalar.

The DOM generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specifying your own tag value can help you to identify where an issue occurred during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

This read-only property displays the URL of the link target of this hyperlink.

The window in which the target will be opened, specified as a character vector or string scalar.

Possible values are:

  • "samewindow" - (default) opens a target in the same window

  • "newwindow" - opens a target in a new window

Note

This property applies only to HTML output-type reports.

Data Types: string | char

Methods

expand all

Examples

collapse all

import mlreportgen.dom.*
d = Document('mydoc');

append(d,ExternalLink('https://www.mathworks.com/','MathWorks'));

close(d);
rptview(d.OutputPath);

Version History

Introduced in R2014b