wordreport

버전 1.2.0.0 (34.2 KB) 작성자: Laurent Vaylet
A Word report generator (ActiveX-based) in an object-oriented way
다운로드 수: 5.5K
업데이트 날짜: 2009/7/6

라이선스 보기

WORDREPORT creates or opens an existing Microsoft Office Word report and provides helper functions to add some content: text, figures, Simulink models, Stateflow charts and much more. It also helps in adding or updating the table of contents, in setting page numbering or in finding text. Actually, it is possible to mimic almost everything you can do manually. Just record a macro in Word and analyze the generated VBA code to find out how to use the ActiveX technology.

Example: create a new document called 'Foo.doc' and add some content (headings, figures, page breaks, page numbers, table of contents)

reportFilename = fullfile(pwd,'foo.doc');
wr = wordreport(reportFilename);
%---
wr.setstyle('Heading 1');
wr.addtext('TOC', [1 1]); line break before and after text
wr.createtoc(1, 3);
wr.addpagebreak();
%---
wr.setstyle('Heading 1');
wr.addtext('MATLAB data', [1 1]); line break before and after text
%---
wr.setstyle('Heading 2');
wr.addtext('Sample table', [0 1]); line break after text
dataCell = { ...
'Test 1', num2str(0.3) , 'OK'; ...
'Test 2', num2str(1.8) , 'KO'};
[nbRows, nbCols] = size(dataCell);
wr.addtable(nbRows, nbCols, dataCell, [1 1]); line break before table
%---
wr.setstyle('Heading 2');
wr.addtext('Sample figure', [0 1]); line break after text
figure; plot(1:10);
title('Figure 1'); xlabel('Temps [s]'); ylabel('Amplitude [A]');
wr.setstyle('Normal');
wr.addfigure();
%---
wr.addpagenumbers('wdAlignPageNumberRight');
wr.updatetoc();
%---
wr.close();
%---
open(reportFilename);

Do not hesitate to ask for more help and more advanced examples, especially when dealing with screenshots of Simulink models and Stateflow charts. I'll be happy to be of any assistance !

인용 양식

Laurent Vaylet (2024). wordreport (https://www.mathworks.com/matlabcentral/fileexchange/17953-wordreport), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R14SP3
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
도움

받음: WriteToWordFromMatlab

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

Updated BSD Organization to The MathWorks, Inc

1.1.0.0

Updated license.txt to BSD

1.0.0.0

Now including a demo for a report generation including Simulink and Stateflow screenshots