MATLAB MATLAB REPORT GENERATOR - RELEASE NOTES Podręcznik Użytkownika Strona 959

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 986
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 958
Display Report Generation Messages
13-107
2
Use the MessageDispatcher.Filter property to specify to display debug
messages.
dispatcher.Filter.DebugMessagesPass = true;
3
Add a listener using the MATLAB addlistener function. Specify the dispatcher
object, the source and event data, and a disp function that specifies the event data
and format to use for the message.
l = addlistener(dispatcher,'Message', ...
@(src, evtdata) disp(evtdata.Message.formatAsText));
4
Include a code to delete the listener. Place it after the code that generates the report.
delete(l);
This report displays debug messages.
import mlreportgen.dom.*;
d = Document('test','html');
dispatcher = MessageDispatcher.getTheDispatcher;
dispatcher.Filter.DebugMessagesPass = true;
l = addlistener(dispatcher,'Message', ...
@(src, evtdata) disp(evtdata.Message.formatAsText));
open(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','html');
delete(l);
Create and Display a Progress Message
This example shows how to create and dispatch a progress message. You can use a
similar approach for other kinds of messages, such as warnings.
Przeglądanie stron 958
1 2 ... 954 955 956 957 958 959 960 961 962 963 964 ... 985 986

Komentarze do niniejszej Instrukcji

Brak uwag