Jump to content

Getting an image over network share with Jaspersoft Studio/ReportServer


Go to solution Solved by arno_1,

Recommended Posts

Posted

Hello everyone,

first of all I have to admit that I'm a Jaspersoft newbie!

So I designed a report with the Studio, which loads a dynamic image based on the query result (String).

For this I created an image object and put this in the expression value field:

  • "\\REMOTE_PC\IMAGE_PATH\"+$F{image_name}+".jpg"
  • "file://REMOTE_PC/IMAGE_PATH/"+$F{image_name}+".jpg"

NOTE: both ways seem to work actually in the Studio preview but not on the Server.

But if i change the $F{image_name} to an actual value, ie. "picture" it will also work on the Server side?!

  • "\\REMOTE_PC\IMAGE_PATH\picture.jpg"
  • "file://REMOTE_PC/IMAGE_PATH/picture.jpg"

Not quite sure, why the way above shouldn't work, so I would be pleased if someone could provide some insight on this topic.

Thank in advance,

Arno

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

I think the server wants a uri of the image. If you upload the image to the server, the uri will be repo://

Try uploading a report with an image on a local pc drive. If you go to the repository view and open the main.jrxml file, you'll see the uri to the image is repo:

  • 4 weeks later...
  • Solution
Posted

Sorry I get back to this topic so late..

It seems to me, that all problems I've got with those network shares were actually windows related (permissions, etc). After switchting to a linux-share all worked great!

Nevertheless I decided to use a webserver for my images, which should be best practice afaik.

Thank you very much for your response Mr. Hozawa =)

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