Compiled report generator script fails.

6 visualizaciones (últimos 30 días)
Michael
Michael el 23 de En. de 2025
Comentada: Michael el 28 de En. de 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)

Respuestas (1)

Kojiro Saito
Kojiro Saito el 24 de En. de 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 comentarios
Michael
Michael el 28 de En. de 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 el 28 de En. de 2025
Further efforts produce not working when running the stand alone app, but launching Command Prompt and running from within Command Prompt does work.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Report Generator en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by