How do I use MATLAB Compiler to compile an application that uses a report and stylesheet generated by MATLAB Report Generator?

3 views (last 30 days)
I have created a report using MATLAB Report Generator. This report uses a custom stylesheet. I have written an MATLAB file called myfile.m that generates the report as follows:
function myfile
report myreport.rpt
myreport.rpt is linked to my custom stylesheet, mystylesheet.rgs. I would like to know how to compile this file so that it will correctly locate the report and stylesheet once I have deployed the application.
After compiling the above program with the command
mcc –m myfile
I receive the following warning message when executing the compiled application
Warning: Could not generate report. Error using ==> rptgen.loadRpt
File "myreport.rpt" not found
> In D:\Applications\MATLAB\R2006b\toolbox\compiler\mcr\matlab\iofun\@rptgen\report.p>locGenerateReport at 182
In D:\Applications\MATLAB\R2006b\toolbox\compiler\mcr\matlab\iofun\@rptgen\report.p>report at 93
In report at 49
In myfile at 2

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 28 Jan 2010
In order to include the report and stylesheet in your application, use MCC's -a flag as follows:
mcc -m myfile.m -a myreport.rpt -a mystylesheet.rgs
This will add the RPT and RGS files to the CTF archive which is created by MATLAB Compiler and these files when then be accessible by the compiled application.
Note that if you modify the call to REPORT to use the absolute path to the report file, then the report file and stylesheet must be located in that same location on the deployment machine and you would not use the -a flag.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!