Report generator issue on standalone application

17 visualizzazioni (ultimi 30 giorni)
Danilo Teran
Danilo Teran il 6 Lug 2017
Commentato: RGB85 il 15 Dic 2023
I am having a big problem. When I use the following line:
report = Document(docname,'html-file');
or
report = Document(docname,'docx');
on workspace it works well, then I compile this gui to a standalone application and I run .exe, but this .exe(standalone application) always fails there.
I really do not know how to correct it, because using matlab it works well and I need to use it on another computer without matlab.
Thanks

Risposte (2)

Vijay A
Vijay A il 25 Gen 2020
Hello Danilo Teran
Initially i had the same problem, you must use the following code to rectify the issue :
  1. Using makeDOMCompilable()
Use the makeDOMCompilable() function in the begning of the program where you need to generate the report.
makeDOMCompilable();
import mlreportgen.dom.*
import mlreportgen.report.*
d = Document("mydoc",'pdf');
open(d);
2. Make sure you have the corresponding version of the matlab runtime installed in your PC.
In order to find the version of your matlab just type ver in your command prompt to check for your matlab version
code to find the matlab version is given below
ver
Click on the link below to move to the download section of the respective MATLAB runtime
Make sure the MATLAB Runtime is installed in the PC where you are using the exe standalone application and you need to install the same version of the MATLAB Runtime where the matlab codes are generated.
3. First compile a simple application without any external arguments to check :
makeDOMCompilable();
import mlreportgen.dom.*
import mlreportgen.report.*
d = Document("myDoc1", "pdf");
open(d);
append(d, Heading1("Spacing Using OuterMargin"));
p1 = Paragraph("This is a paragraph with a bottom outer margin of 50pt.");
p1.Style = {OuterMargin("0pt", "0pt","0pt","50pt")};
append(d, p1);
p2 = Paragraph("This is a paragraph with a bottom outer margin of 25pt.");
p2.Style = {OuterMargin("0pt", "0pt","0pt","25pt")};
append(d, p2);
p3 = Paragraph("This is a paragraph with a bottom outer margin of 5pt.");
p3.Style = {OuterMargin("0pt", "0pt","0pt","5pt")};
append(d, p3);
append(d, Text("Text to show spacing"));
close(d);
rptview(d);
4. If the above method does not work just text me or inbox me will give you another solution. I have face issues like this initially but now i resolved the issue.
Good luck
  2 Commenti
Sreejith Themath
Sreejith Themath il 16 Mag 2020
I request your support:
I have written some code for my project work.
When I am Running from Matlab environemt Its woking fine. However when I make a standaloe app ots showing the following error
Error using mlreportgen.ppt.Presentation/add
Unable to check out a Report Generator license. Reason: ''
I checked and confirmed that I have valid Report generator license.
I have written makeDOMCompilable(); on top of my code.
I have installed the lattest matlab run time.
Can you help me to debug this issue.
makeDOMCompilable();
import mlreportgen.ppt.*
slidesFile = basic.pptname;
slides = Presentation(slidesFile,'Template.pptx');
slide_no=1;
para = Paragraph("Base data");
data= Paragraph(data_txt);
slide(slide_no) = add(slides,'Content');
replace(slide(slide_no),'Title',para);
replace(slide(slide_no),'Content',data);
close(slides);
Rahul Singhal
Rahul Singhal il 22 Mag 2020
Hi Sreejith,
To compile a PPT API program, you will have to use makePPTCompilable() instead. See https://www.mathworks.com/help/rptgen/ug/compile-a-presentation-program.html
Thanks,
Rahul

Accedi per commentare.


Vijay A
Vijay A il 21 Gen 2020
Have you figured out this issue plesae inbox me
  4 Commenti
Adam Danz
Adam Danz il 18 Dic 2020
@Jorge Torres, are you getting an error message? If so, please provide the full message.
If you aren't getting an error message, could you describe the problem with the commented section?
RGB85
RGB85 il 15 Dic 2023
I know this post is a few years old, but I'm having the same problem. I copied the code for the simple application above, compiled it, and the resulting app would not generate the report. I'm using a similar approach in one of my apps which is how I found this thread. As far as I can tell, the document command does not work in a compiled app. Is there any solution to this issue?

Accedi per commentare.

Categorie

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

Community Treasure Hunt

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

Start Hunting!

Translated by