Matlab Report Generator append function error ?

I have a code which generates a Word report (using Matlab report generator toolbox). This code works perfectly when I launch it on Matlab. However, when I compile it (using Matlab compiler toolbox) in EXE file, and I launch this EXE file, there is an error at line 5 (append function). For the license, I have a valid license. I think that the problem concerns the compilation. Anyone has the same problem or knows how to fix it ?
My code:
function test
import mlreportgen.dom.*;
d=Document('c:\abc.docx','docx');
t=Paragraph('test');
append(d,t);
close(d);
end
Error message:
"Unable to check out a Report Generator license. Reason: ''. Error in => test.m at line 5"

Respuestas (2)

Sean de Wolski
Sean de Wolski el 30 de Oct. de 2015
You need to include the following in the test file before compiling it:
% If compiling, make the DOM compilable
if ismcc || isdeployed
% Make sure DOM is compilable
makeDOMCompilable()
end

5 comentarios

check Koutam
check Koutam el 30 de Oct. de 2015
Thanks for your answer
But I'm using Matlab 2014a and it don't regconize makeDOMCompilable :(
Sean de Wolski
Sean de Wolski el 30 de Oct. de 2015
I'm confused, the DOM api was formally introduced in R2014b.
If you're using it in 14a, it must be an undocumented version which would explain the lack of compiler support. Can you upgrade?
check Koutam
check Koutam el 2 de Nov. de 2015
I cannot update my Matlab (have to pay to have the more recent version) I think that the error may be concern the DOM rather than the compilation. So, I'm looking to download the makeDOMCompilable function, but I don't find it. Do you have this ?
Sean de Wolski
Sean de Wolski el 3 de Nov. de 2015
No, it was released in R2014b. You will need to renew maintenance and upgrade in order to compile the DOM.
farzad
farzad el 21 de Mayo de 2020

Iniciar sesión para comentar.

check Koutam
check Koutam el 26 de Mayo de 2016

0 votos

I found the answer for my question, I must put makeDOMCompilable; in my code, before import mlreportgen.dom.*;

2 comentarios

Brandon Zepeda
Brandon Zepeda el 12 de En. de 2017
Where does it put the executable? It isn't working for me. Script runs, however, the exe is not created.
Brandon, you should probably open a new question. Are yo using the compiler app to build it?
applicationCompiler
Under settings you can tell it where to put the exe.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Report Generator en Centro de ayuda y File Exchange.

Preguntada:

el 30 de Oct. de 2015

Comentada:

el 21 de Mayo de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by