Matlab Report Generator not finding .dotx file after compiling
I’m having some issues using Report Generator to create a .docx from a .dotx template in a compiled web app. It works fine in the app designer but as soon as it is compiled and on the web app server it can no longer find the template file. I have ensured that the Template.dotx file is included in the package while compiling.
The log shows
2024-04-26 14:59:15 Error using mlreportgen.dom.Document/open
2024-04-26 14:59:15 Unable to find template: Template.dotx.
[file,path] = uiputfile(‘*.docx’, ‘Analyzed’, [app.name1 ‘_AN’]);
if isequal(file,0)
disp(‘User selected Cancel’)
else
docxname = fullfile(path,file);
end
makeDOMCompilable();
import mlreportgen.dom.*
import mlreportgen.report.*
D = Document(docxname,’docx’,’Template.dotx’);
open(D);
moveToNextHole(D);
append(D, info);…….
close(D)I’m having some issues using Report Generator to create a .docx from a .dotx template in a compiled web app. It works fine in the app designer but as soon as it is compiled and on the web app server it can no longer find the template file. I have ensured that the Template.dotx file is included in the package while compiling.
The log shows
2024-04-26 14:59:15 Error using mlreportgen.dom.Document/open
2024-04-26 14:59:15 Unable to find template: Template.dotx.
[file,path] = uiputfile(‘*.docx’, ‘Analyzed’, [app.name1 ‘_AN’]);
if isequal(file,0)
disp(‘User selected Cancel’)
else
docxname = fullfile(path,file);
end
makeDOMCompilable();
import mlreportgen.dom.*
import mlreportgen.report.*
D = Document(docxname,’docx’,’Template.dotx’);
open(D);
moveToNextHole(D);
append(D, info);…….
close(D) I’m having some issues using Report Generator to create a .docx from a .dotx template in a compiled web app. It works fine in the app designer but as soon as it is compiled and on the web app server it can no longer find the template file. I have ensured that the Template.dotx file is included in the package while compiling.
The log shows
2024-04-26 14:59:15 Error using mlreportgen.dom.Document/open
2024-04-26 14:59:15 Unable to find template: Template.dotx.
[file,path] = uiputfile(‘*.docx’, ‘Analyzed’, [app.name1 ‘_AN’]);
if isequal(file,0)
disp(‘User selected Cancel’)
else
docxname = fullfile(path,file);
end
makeDOMCompilable();
import mlreportgen.dom.*
import mlreportgen.report.*
D = Document(docxname,’docx’,’Template.dotx’);
open(D);
moveToNextHole(D);
append(D, info);…….
close(D) report generator, compiler, web app, template MATLAB Answers — New Questions