emrizwan Posted March 26, 2015 Posted March 26, 2015 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
nuno-miguel-lourenco Posted March 26, 2015 Posted March 26, 2015 You need to push that image into JasperReports Server and reference it in your report as a repository resource from the server.
Tom C Posted March 26, 2015 Posted March 26, 2015 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 emrizwan Posted March 30, 2015 Author Solution Posted March 30, 2015 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 asfilePath=FacesContext.getCurrentInstance().getExternalContext().getRealPath("/images/company_logo.png");and in the reprt paramaters. m.put("pImagePath",filePath); hope this helps.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now