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.MessageDispatcher.dispatch

Package: mlreportgen.dom

Dispatch DOM status message

Syntax

dispatch(dispatcher,message)

Description

example

dispatch(dispatcher,message) dispatches a DOM status message.

Examples

collapse all

This example shows how to add a progress message to display when generating a report.

Add a dispatcher and listener to the report.

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';
append(d,p);
     
close(d);
rptview('test',doctype);
     
delete (l);
 

Check the progress messages in the MATLAB® Command Window. The starting chapter message appears, in addition to the predefined DOM progress messages.

Input Arguments

collapse all

DOM message dispatcher, specified as an mlreportgen.dom.MessageDispatcher object.

Use one of the following types of DOM message objects:

  • mlreportgen.dom.ProgressMessage

  • mlreportgen.dom.WarningMessage

  • mlreportgen.dom.ErrorMessage

  • mlreportgen.dom.DebugMessage

Introduced in R2014b

Was this topic helpful?