programmatically define save location of reports generated through mlreportgen.dom

6 ビュー (過去 30 日間)
Mattj.d.
Mattj.d. 2018 年 5 月 31 日
i'm figuring out how to programmatically generate reports with matlab, I've got a finished product for one of the experiments I run. I am using mlreportgen.dom
The current save location is at
C:/Users/AppData/Local/Temp/mlreportgen
how can I programmatically define that location in matlab? I've changed the output path as shown in here
https://www.mathworks.com/help/rptgen/ug/mlreportgen.dom.document-class.html
but that only changes were the .htmx file saves, which is no good.

回答 (1 件)

Wilson A N
Wilson A N 2018 年 6 月 22 日
Hi Mattj,
I was able to use the 'OutputPath' parameter given in the mlreportgen.dom for saving the output files in .pdf, .html, .docx into the specified outpath path. I modified the same example given in the documentation page you had listed. The modified code is given below:
import mlreportgen.dom.*;
d = Document('mydoc','pdf');
d.OutputPath = 'E:\Workspace\Newpath.pdf'
append(d,'Hello World');
close(d);
rptview(d.OutputPath);
Can you provide a sample code so that I can check it out at my end.
  1 件のコメント
Gwendolyn Williams
Gwendolyn Williams 2024 年 3 月 6 日
I realize it's been awhile since anyone touched this thread, but just in case anyone else needed to know:
Yes, using d.OutputPath works to set the output path for the report.
I used a report (rpt = Report('reportname','pdf'), and it worked beautifully.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by