benoracle Posted May 7, 2013 Share Posted May 7, 2013 Recently i have been working on an online reporting tool that integrates php and Jasper Reports. I designed the reports using IReport designer then compiled them ran and all was well not untill i decided to test them in the JavaEE web application. This report has a reference to an image that seem to bring alot of problems when requesting for the report. Her is the source code below:response.setContentType("application/pdf");//set the content type to application/pdfServletOutputStream out = response.getOutputStream();InputStream resourceAsStream = getServletContext().getResourceAsStream("/reports/CaltexSales.jasper");JasperRunManager.runReportToPdfStream(resourceAsStream, out, new HashMap(), connection);out.flush(); ***This works well with reports that do not have image references in them.Can anyone please show me how to reference the images, they are in the same directory /reports Link to comment Share on other sites More sharing options...
benoracle Posted June 12, 2013 Author Share Posted June 12, 2013 <parameter name="LOGO" class="java.io.InputStream" isForPrompting="false"> <defaultValueExpression><![CDATA[]]></defaultValueExpression> </parameter>..[/code] I think i am going to answer myself, I just had to have a java.io.InputStream as one of my parameters here is the code snippet of the jrmx file. Link to comment Share on other sites More sharing options...
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