Compiled report generator script fails.

9 visualizzazioni (ultimi 30 giorni)
Michael
Michael il 23 Gen 2025
Commentato: Michael il 28 Gen 2025
I am receiving an error in a compiled script for report generator.
Here is the script:
makeDOMCompilable();
import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report('Test','pdf');
%open(rpt);
% titlepage
%I = imread(img);
%imshow(I);
tp = TitlePage;
%location = pwd;
tp.Title = 'Just a Test';
tp.Image = which(strcat('duel.jpg'));
%tp.Author = Analyst();
tp.Publisher = 'Mike Fisher';
tp.PubDate = date();
tp.Subtitle = 'GTG';
add(rpt,tp);
add(rpt,LineBreak);
close(rpt);
rptview(rpt);
Runs fine in the command window. Compile it and run, get this error:
Error using mlreportgen.dom.Image
Invalid image type: .
Error in mlreportgen.report.TitlePage/getImageReporter
Error in mlreportgen.report.TitlePage/getImag
Error in mlreportgen.report.ReportForm/fillHole
Error in mlreportgen.report.TitlePage/processHole
Error in mlreportgen.report.ReportForm/fillForm
Error in mlreportgen.report.ReporterBase/getDocumentPart
Error in mlreportgen.report.ReporterBase/getImpl
Error in mlreportgen.report.internal.LockedForm.add
Error in mlreportgen.report.ReportBase/append
Error in mlreportgen.report.ReportBase/add
Error in JTest (line 28)

Risposte (1)

Kojiro Saito
Kojiro Saito il 24 Gen 2025
It seems that duel.jpg is not included in the compiled script, so tp.Image is not an image format then add(rpt,tp) gives an error.
You need to add duel.jpg in "Files required for your application to run" of Application Compiler or add "-a duel.jpg" option in mcc command.
  2 Commenti
Michael
Michael il 28 Gen 2025
That does not solve the problem. The report generator must be able to look at several different file folders and pick a particular image (all named the same) from a specific folder. I cannot compile the images with the application, they change.
Michael
Michael il 28 Gen 2025
Further efforts produce not working when running the stand alone app, but launching Command Prompt and running from within Command Prompt does work.

Accedi per commentare.

Categorie

Scopri di più su MATLAB Report Generator in Help Center e File Exchange

Prodotti


Release

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by