Main Content

mlreportgen.dom.LineBreak class

Package: mlreportgen.dom

Line break in a Word or PDF report

Description

Use an object of mlreportgen.dom.LineBreak to insert a line break anywhere in a Microsoft® Word or PDF report.

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

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

example

lBreak = mlreportgen.dom.LineBreak() creates a line break object.

Properties

expand all

Children of this DOM API object, specified as an array of DOM API objects.

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

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

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

ID for this DOM API object, 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

Parent of this DOM API object, specified as a DOM API object.

Attributes:

GetAccess
public
SetAccess
private
NonCopyable
true

Format objects that specify the format of a document element.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Name of the style to apply from the style sheet, specified as a character vector or string scalar.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Tag for this DOM API object, 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

Methods

expand all

Examples

collapse all

This example shows how to insert a line break in a PDF report by using a LineBreak object.

Import the DOM API package so you do not have to use long, fully qualified names.

import mlreportgen.dom.*;

Create a Document object and open it.

d = Document("LineBreakReport","pdf");
open(d);

Create the first page and add a heading to the object. Create a Paragraph object p.

h = Heading1("Learning to Use Line Breaks");
append(d,h);
p = Paragraph("Use a LineBreak object");

Specify preserve for the WhiteSpace method for the Paragraph object to add a line break to it. Append the LineBreak handle class to the paragraph.

p.WhiteSpace = 'preserve';
append(p,LineBreak);

Insert the next line by appending it to the existing Paragraph object. Append the paragraph to the Document.

append(p,"to force a new line in a paragraph");
append(d,p);

Close and view the document.

close(d);
rptview(d);
Introduced in R2016b