Contenido principal

mlreportgen.dom.BlockHoleContent Class

R2026b

Namespace: mlreportgen.dom

Content for a block template hole

Since R2026b

Description

A BlockHoleContent object represents the content for a block hole defined in a template. A block hole can contain block-level elements such as paragraphs, tables, and lists.

You do not create BlockHoleContent objects directly. Access them through the Holes property of a template-based DOM object such as mlreportgen.dom.Document or mlreportgen.dom.DocumentPart.

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

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

Properties

expand all

Default style name for content appended to this hole, returned as a character vector. The template definition assigns this style name to appended content that does not specify a style name. The template definition determines the value.

Attributes:

GetAccess
public
SetAccess
private

Data Types: char | string

Methods

expand all

Limitations

  • Before the write position advances past a hole, append content to that hole. After moveToNextHole advances past a hole, appending to that hole causes a holeContentCannotAppend error.

Examples

Fill Block Holes with a Paragraph and List

import mlreportgen.dom.*

d = Document("myReport","docx","myTemplate");

dp = DocumentPart(d,"MySection");

p = Paragraph("Summary text");
dp.Holes("Summary").append(p);

list = UnorderedList(["Item 1","Item 2","Item 3"]);
dp.Holes("Items").append(list);

append(d,dp);
close(d);
rptview(d);

More About

expand all

Version History

Introduced in R2026b