moveToNextHole

Class: mlreportgen.dom.Document
Package: mlreportgen.dom

Move document append point to next template hole

Description

example

holeID = moveToNextHole(docObj) copies to the output document any text between the current hole and the next hole in the document template. DOM creates an mlreportgen.dom.RawText object for the text. This method makes the next hole the current hole and returns the ID of that hole.

Examples

expand all

import mlreportgen.dom.*;
myReport = Document('myDoc','docx');

moveToNextHole(myReport);

Input Arguments

expand all

Document in which to move the append point to the next hole.

Output Arguments

expand all

The ID of the template hole that the method moves to (the new current hole).

Data Types: char

Tips

The first time you invoke the moveToNextHole method, the DOM copies to the output document all of the text up to the first hole in the template. Use Document.append methods to add content to the output document to fill the first hole. The next time you invoke moveToNextHole, the DOM copies to the output document all the text between the first and second hole in the template. Then use Document.append methods to fill in the second hole. In this way, you can successively fill all of the holes in a document.

Introduced in R2014b