Main Content

createAutoNumberStream

Class: mlreportgen.dom.Document
Namespace: mlreportgen.dom

Create numbering stream

Description

streamOut = createAutoNumberStream(docObj,streamName) creates a numbering stream using Arabic numbers and an initial value of 0.

example

streamOut = createAutoNumberStream(docObj,streamName,streamType) creates a numbering stream using the specified type of characters (Arabic numbers, alphabetic, or Roman numerals) and an initial value corresponding to 0 (for example, a or i).

streamOut = createAutoNumberStream(docObj,streamName, streamType, initialValue) creates a numbering stream using the specified type of characters (Arabic numbers, alphabetic, or Roman numerals) and specified initial value.

Examples

expand all

import mlreportgen.dom.*;
myReport = Document('mydoc','html');

chapStream = createAutoNumberStream(myReport,'chapter','I');
for i=1:5
    p = Paragraph('Chapter ');
    p.Style = {CounterInc('chapter')};
    p.WhiteSpace = 'pre';
    append(p,AutoNumber('chapter'));
    append(myReport,p);
end

close(myReport);
rptview(myReport.OutputPath);

Input Arguments

expand all

Document to apply numbering stream to, specified as an mlreportgen.dom.Document object.

Consider using a name that indicates the kinds of document element (for example, a chapter heading) that you expect to apply the stream to.

Use one of these letters to specify the type of characters to use for the numbering values.

  • 'n' — Arabic numerals (you can also use 'N')

  • 'a'— Lowercase alphabetic letters (a, b, c,...)

  • 'A' — Uppercase alphabetic letters (A, B ,C,...)

  • 'i' — Lowercase Roman numerals (i, ii, iii,...)

  • 'I' — Uppercase Roman numerals (I, II, III,...)

Use a number, regardless of the type of stream. The initial value used by the stream depends on the type of stream. For example, if you set initialValue to 0:

  • Arabic numeral stream — 0

  • Alphabetic stream — a or A

  • Roman numerals stream — i or I

Data Types: double

Output Arguments

expand all

A numbering stream, represented by an mlreportgen.dom.AutoNumberStream object.

Tips

When you append an mlreportgen.dom.AutoNumber object, specify a numbering stream.

Version History

Introduced in R2014b