This example shows how to add a progress message
to display when generating a presentation.
Add a dispatcher and listener to the report. Configure
the dispatcher to include debug messages.
import mlreportgen.ppt.*;
pre = Presentation('myPresentation.pptx');
dispatcher = MessageDispatcher.getTheDispatcher;
dispatcher.Filter.DebugMessagesPass = true;
l = addlistener(dispatcher,'Message', ...
@(src, evtdata) disp(evtdata.Message.formatAsText));
Create a progress message.
dispatch(dispatcher,ErrorMessage('invalid slide',pre));
open(pre);
titleText = Text('This is a Title');
titleText.Style = {Bold};
replace(pre,'Title',titleText);
Generate the presentation and delete the listener.
close(pre);
delete(l);
Check the progress messages in the MATLAB® Command
Window. In addition to the predefined PPT progress messages, the starting
chapter message added in this example appears. The output
also includes debug messages.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.