Main Content

formatAsText

Class: mlreportgen.dom.ProgressMessage
Package: mlreportgen.dom

Format message as text

Description

example

textMessageOut = formatAsText(message) returns the message text formatted as text.

Examples

expand all

This example uses formatAsText with the Web command to display the progress messages.

import mlreportgen.dom.*;
doctype = 'html';
d = Document('test',doctype);
d.Tag = 'My report';
     
dispatcher = MessageDispatcher.getTheDispatcher;
l = addlistener(dispatcher,'Message', ...
      @(src, evtdata) disp(evtdata.Message.formatAsText));
     
open(d);
dispatch(dispatcher,ProgressMessage('starting chapter',d));
p = Paragraph('Chapter ');
p.Tag = 'chapter title';
p.Style = { CounterInc('chapter'),...
    CounterReset('table'),WhiteSpace('pre') };
append(p, AutoNumber('chapter'));
append(d,p);

close(d);
rptview('test',doctype);
     
delete(l);

Input Arguments

expand all

The DOM message, specified as an mlreportgen.dom.ProgressMessage object.

Output Arguments

expand all

DOM progress message formatted as text, represented by an mlreportgen.dom.ProgressMessage object.

Introduced in R2014b