Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.dom.Document.createAutoNumberStream

Package: mlreportgen.dom

Create numbering stream

Syntax

streamOut = createAutoNumberStream(docObj,streamName)
streamOut = createAutoNumberStream(docObj,streamName,streamType)
streamOut = createAutoNumberStream(docObj,streamName, streamType, initialValue)

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

collapse 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

collapse 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

collapse all

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

Tips

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

Introduced in R2014b

Was this topic helpful?