Matlab Report Generator errors occasionally when closing the document, why?

26 Ansichten (letzte 30 Tage)
I am using the Matlab Report Generator to build and save a PDF report that I built using HTML and CSS. Occasionally when it is building the reports I will get 1 of 2 errors. The first one I know what is causing the problem, but wanted to know if there is a better way of testing for it. The other I have no clue about. The errors I get are:
  1. If an object inside of a table or div take up more space than has been allocated to them it will freeze Matlab ( It doesn't actually freeze, but I can't interact with anything in Matlab, and if I try to close it down Matlab will say that it is unresponsive and needs to shut down. I usually end of ending the task in the Task Manager because it is so much faster, though I am certain this is bad.) I then have to spend a lot of time trying to figure out which object is too large.
  2. It will throw this error when closing the document:
Error using mlreportgen.dom.Document/close
Error closing document package: Could not commit changes: Could not move the original package to temporary location: Permission denied Permission denied
Error in makerpt (line 345)
close(rpt);
Error in BuildDataReportGenereator (line 42)
makerpt(Data, ReportFileName);
I want to be able to at some point deploy this using the Compiler SDK, but I don't want to include a try-catch to prevent this if there is a way to test that it will happen.

Antworten (1)

Sailesh Sidhwani
Sailesh Sidhwani am 30 Aug. 2017
Hi Timothy,
1. Regarding the first issue, it is difficult to say what is happening with this limited information. But from your question it looks like there are some memory related issues which could be causing this. Following is the troubleshooting documentation page that could be helpful, as it speaks about memory allocation during report generation:
Additionally, you can also generate Report Log File to debug this issue further. Following is the link which tells you how to generate the logs: https://www.mathworks.com/help/rptgen/ug/creating-log-files.html
.
2. Regarding the document close error, there should be a ‘*_FO’ directory created in the working directory when a report was created. If creation of that report failed for some reason, that directory is remained and prevents additional reports using the same name. Deleting that directory should resolve this issue.
  1 Kommentar
Robert Brumer
Robert Brumer am 31 Aug. 2017
Bearbeitet: Robert Brumer am 31 Aug. 2017
Hi Sailesh,
I am myself having the same error with permission denied. I have seen the '*_FO' directory when the file fails to be created properly, but deleting it has not made a difference with the error. I see a very similar error to the previous user:
Error using mlreportgen.dom.Document/close
Error closing document package: Could not commit changes: Could not rename the temporary package to
final location: Permission denied Permission denied
However, here it fails to go to "final location" as opposed to "temporary location." I know Matlab has access to edit files in this directory, as it has no trouble doing so with other functions (e.g. print or xlswrite), but for some reason it's having trouble with the Report Generator.
Edit: Without having changed anything, I'm now seeing the error
"Cannot remove directory: [...]_FO

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by