Inconsistent Invalid Image path error in Report Generator

조회 수: 2 (최근 30일)
Allan Brett
Allan Brett 2017년 5월 24일
댓글: Rinnah Chikosi 2020년 7월 19일
I am using Matlab R2016a. I am attempting to generate a template Direct PDF report however, I am getting inconsistent results when specifying custom directories. Report generation works when I run it from a code repo for development (directory set to present working directory), but sometimes fails when I change the report file location to a "custom directory". The error message "Invalid Image Path" is thrown. The path indicated in the error message is indeed not the correct path to the image files. It is searching for the images in the "...\Custom_Directory\" and not "...\Custom_Directory\filename_pdf_files". But as I mentioned, it is inconsistent, as sometimes it searches for the images in the correct location, and sometimes not. For instance if I change the custom directory to:
C:\Users\Username\Documents
The report generates without error and finds the images folder. But if I change it to:
C:\Users\username\Documents\test
It searches for the images in "C:\Users\username\Documents\test" instead of "C:\Users\username\Documents\test\filename_pdf_files", and therefore throws an error.
Additionally, if I set the custom directory to my repo location, again it works and finds the image files. Any help sorting this out would be greatly appreciated.
  댓글 수: 3
Allan Brett
Allan Brett 2017년 5월 29일
I am simply using the Report Explorer GUI and passing the path into the "Directory" field in the "Report Options" menu. I am not calling Report Generator programmatically as I am still developing the report. There is no option that I can see to manually point report generator to this auto-generated images folder.
Rinnah Chikosi
Rinnah Chikosi 2020년 7월 19일
You need to add the images folders to your matlab file path.
To do this got to the home tab > in the environment section, select "set path", and add the folder to make it part of your file path.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by