メインコンテンツ

mlreportgen.dom.KeepWithNext Class

Namespace: mlreportgen.dom

Keep document element on same page as next

Description

Use objects of the mlreportgen.dom.KeepWithNext class to keep a document element on the same page as the document element that follows it. This format applies to Microsoft® Word and PDF documents.

This class is only compatible with these MATLAB® Report Generator™ output types:

  • "docx"

  • "pdf"

  • "pdfa" (since R2025a)

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

Creation

Description

obj = KeepWithNext keeps the document element on the same page as the document element that follows it. The document element must be a paragraph, table row, or list item.

obj = KeepWithNext(onOff) sets the Value property to onOff.

Properties

expand all

Whether to keep the document element on the same page as the following document element, specified as a logical 1 (true) or 0 (false). When you specify:

  • 1 (true) — Keep the following document elements on the same page according to the value of the Strength property.

  • 0 (false) — Allow the following document elements to move to the next page.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Strength that the document elements stay together on the same page, specified as "always" or an integer. When you specify the property as "always", the DOM object always keeps the document elements together on the same page. When you specify the property as a positive integer, the size of the integer dictates the strength that the document elements stay together. The greater the integer, the less likely the document elements appear on separate pages.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Tag, specified as a character vector or string scalar. The DOM API 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. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Version History

Introduced in R2014b