Jump to content
We've recently updated our Privacy Statement, available here ×

image resource / not found


gramberg

Recommended Posts

Hi,

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

Yours Bernhard

 

 

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

> - 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.

Thanks,

Kristen

Link to comment
Share on other sites

HI,

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
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:193)



Post Edited by gramberg at 06/14/2010 21:51
Link to comment
Share on other sites

Hi,

 

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

at net.sf.jasperreports.engine.util.JRLoader.loadBytesFromLocation(JRLoader.java:470)

at net.sf.jasperreports.engine.JRImageRenderer.getInstance(JRImageRenderer.java:176)

at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:944)

 

Link to comment
Share on other sites


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 .

Ramnik Kaur

Senior QA Engineer

Link to comment
Share on other sites

Hi,

 

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:

 

 

Yours Bernhard

 

 

Link to comment
Share on other sites

I chnged the position,

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

at net.sf.jasperreports.engine.util.JRLoader.loadBytesFromLocation(JRLoader.java:470)

at net.sf.jasperreports.engine.JRImageRenderer.getInstance(JRImageRenderer.java:176)

at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:944)

 

Link to comment
Share on other sites

  • 3 weeks later...

To reference repository resources, you'll need to use repo:.. URIs.  For instance, if you uploaded the image as a reource named "wood" under the "images" folder, you would use repo:/images/wood as image expression in the report.

Regards,

Lucian

Link to comment
Share on other sites

  • 8 months later...

 Hello

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, 

 

J.

 

Link to comment
Share on other sites

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 !

J.



Post Edited by cerien at 03/23/2011 18:07
Link to comment
Share on other sites

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.

ImageDir= "http://xxx.com:8080/ImageStore"

I then use:

       Logo=$P{ImageDir} +"/myLogo.png"

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"

    Logo=$P{LocalImageDir} +"/myLogo.png"

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.

 

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...