Jump to content

How to set image path in a web application


Go to solution Solved by emrizwan,

Recommended Posts

Posted

Hi,

I am using ireport 4.

I've created a report with an image. this image is located at my local C drive.

I am calling this report from a web application.

How can I set the image path to look at my applications root and not from my local machine?

 

thanks

 

 

 

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

You can use your web server to host your web content. All you need to do is to create a sub folder in your web application root and drop your image file to that folder, then reference this image in your report through an absolute domain name path.

 

For exmple, drop your image file "image1.jpg" to ..webappsjasperserver-proimages folder, then use the following image reference in your report:

http://your_domain.com:8080/jasperserver-pro/images/image1.jpg[/code]

 

  • Solution
Posted

I've found a workaroun for this where I don't need to install report server.

I've created a parameter pImagePath and set  the image expression property as $P{pImagePath}.

From my web application (ADF application) I am passing value to this variable as

filePath=FacesContext.getCurrentInstance().getExternalContext().getRealPath("/images/company_logo.png");

and in the reprt paramaters.

 m.put("pImagePath",filePath);

 

hope this helps.

 

 

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