Inconsistent Invalid Image path error in Report Generator

1 visualización (últimos 30 días)
Allan Brett
Allan Brett el 24 de Mayo de 2017
Comentada: Rinnah Chikosi el 19 de Jul. de 2020
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 comentarios
Allan Brett
Allan Brett el 29 de Mayo de 2017
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 el 19 de Jul. de 2020
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by