I am new to JasperServer and made first Tests.
Jasperserver is running fine, but the Report,
which contains wood.jpg gives error (wood.jpg missing).
I imported the wood.jpg from Windows Z:\\images\\wood.jpg.
and named the resource wood
- does the recource-name must be the same as the filename ? (wood.jpg instead of wood?)
- Is this a real Upload of the JPG ?
- Where do I find the uploaded files in Unix-Filesystem ?
or is it imported in the SQL-database
> - does the recource-name must be the same as the filename ? (wood.jpg instead of wood?)
Yes, you need to specify the exact file name, including the file extension.
> - Is this a real Upload of the JPG ?
I'm not sure how you mean "real" but I think the answer is "yes."
> - Where do I find the uploaded files in Unix-Filesystem ?
> or is it imported in the SQL-database
The file is stored in the RDBMS that you specified during installation.
real upload means: copy the file-data into the RDBMS.
I have an wood.jpg-image now, but get the following error message.
Any Idea, what must the changed ?
com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : wood.jpg
Post Edited by gramberg at 06/14/2010 21:51
I changed the value from wood.jpg to "wood.jpg".
This changes the error message, but still gives an error.
com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.JRException: Byte data not found at location : wood.jpg
In the JRXML ,
- using the report wizard , you can add the resource -> by clicking -> Add Resources and selecting the image. this will ad dthe image resource with proper prefix ..e.g. if the image is saved under -> /oragnization_1/Image , you need to have that prefix in teh JRXML
- If you are using report wizard to do it, it will be done automatically , you may not need to edit the JRXML by hand .
Senior QA Engineer
thank you for the fast answer.
I think, mny problem is, that I work in two worlds (Windows + Unix).
I prepare the Report with the wizard at Windows and get filename like c:\\images\\wood.jpg. So teh filke is stored in the Windows file-System
My JasperServer is running ob my Linux-System. I imported the JRXML. Where the "wrong" filename is located. Because on the Linux-System, there is no C:\\.
But I will try now to edit the JRXML-File and use /image/wood.jpg.
This /image seems to be the logical place, where the file is.
So the main question is: how are JPGs handeled easy, if I create
the Report within Windows and transfer it to the linux-Jasperserver
wihout editing the JRXML:
still not working.
com.jaspersoft.jasperserver.api.JSExceptionWrapper: Byte data not found at location : /images/wood.jpg
com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.JRException: Byte data not found at location : /images/wood.jpg
I am in the same situation - I developp the reports using iReports on a Windows machine, and want to execute them on a unix box, with jasperserver.
I've succesfully managed to upload the report, and display graphics, by either specifying a full path for the image, like "/tmp/image.jpg" or a repo link ("repo:/Reports/image.jpg"). However, with this path, the reports doesnt work any longer on Windows Ireport.
How can I have one unique link, working for unix and windows - alternatively, when I specify a path (like the /tmp/imagE.jpg), in which directory does jasperserver looks for ? I could then load the images with no absolute path, and that would do the trick,
I am actually quite happy using iReports, it is a great tool.
thanks for the help,
ok... I did a bit of err & try, and can answer this !
Here is how I got it working
a) create the report on the windows box, stating the resource name "image.jpg" - no path
b) have the image stored in the same dir as the report (jrxml)
c) upload the report to the unix box
d) copy "image.jpg" to /opt/jasperserver-ce-3.7.1/apache-tomcat/webapps/jasperserver/WEB-INF/classes
you may need to adapt the beginning of the path depending on your install
and it works - same jrxml on the windows and unix box ! Not sure if it is the academic way... but it is good for me !
Post Edited by cerien at 03/23/2011 18:07
The way I do this is to deploy an app with all my images to the app server along with jasperserver, so for instance on Tomcat I create a directory under webapps call ImageStore. Then in my jrxml I use a propery to get to the app.
I then use:
As the property name for the actual image resource.
This assumes that the machine you are working on has access to the app server. If not I also have a property for file being local:
LocalImageDir = "/usr/user1/reports/Images"
This works fine for me, it is probably better ro have the atual data in the db, but it was a apin for me to get it working nicely with iReport and deployed version correctly.