Jump to content
JasperReports Library 7.0 is now available ×

no loading image


Recommended Posts

By: karibouxe - karibouxe

no loading image

2006-05-22 02:57

Hi,

 

i come back on this problem. I want to take a logo in my reports. But it don't display.

When i try to check the flag "isLazy". There are only for my HTML report on IE, that it work. But not in pdf. When i try without the flag "isLazy". My logo don't never display.

 

Actually, in my .jrxml:

<image isLazy="true" onErrorType="Blank" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

x="2"

y="2"

width="47"

height="46"

key="image-1"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>

<graphicElement stretchType="NoStretch"/>

<imageExpression class="java.lang.String"><![CDATA["\reporting\template\imagesJasper\logo.jpg"]]></imageExpression>

</image>

 

For information, i use jasper1.2.2 and i try with a string.

 

Do I use a URL or not? Do I forget a flag? Do I forget to fixe a parameter?

 

Thanks for your advices

 

 

 

 

 

 

By: invisible - vohinh

RE: no loading image

2006-05-22 03:20

Hi karibouxe,

 

I added my logo on the report as follow:

Add an image to the report and set the image property to a parameter, e.g: $P{imagePath}

And in jsp file I pass the real path of the image to "imagePath" parameter before run the report to pdf.

 

Hope this help.

 

 

 

 

By: karibouxe - karibouxe

RE: no loading image

2006-05-23 01:59

i try your solution but i have problems:

look my code:

in my jsp:

HashMap parameters = new HashMap();

parameters.put("imagePath", "/template/imagesJasper/logo.jpg");

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, connection);

 

in my report, i define a parameter with:

parameter name:imagePath

parameter class type:string

 

and my image is defined by:

image expression:$P{imagePath}

image expression class:string

 

with that, i'm blank page :-S

 

 

 

 

By: invisible - vohinh

RE: no loading image

2006-05-23 06:37

Do you use iReport to create jrxml file and compile it to jasper? If yes then will the image display normally in a report with only a imgage that selected from file and the report run without any connection to database? If it can display then I think maybe you did a wrong step somewhere.

The last solution: i think you should try to pass the real path of file to the paratmeter instead of indirect path that you're using,

 

Sorry for my bad English, hope you can understand me :)

 

 

 

 

By: karibouxe - karibouxe

RE: no loading image

2006-05-23 06:47

sorry, i found the problem. Acrobat reader didn't found my logo. So acrobat reader display a blank page. But now, i use a parameter to talk my logo. And it's work. And maybe rapidly with excel.

thanks for your help

 

 

 

 

By: gio1313 - gio1313

RE: no loading image

2006-05-24 06:04

Hi,

 

I have a problem when i display my report in HTML style. I use iReports and my report test is very simple. In this report (test) there aren't any immage and when i display ( export to html ) it on my browsers there are X where it want a immage. I use this code for display my report :

res.setContentType("text/html");

PrintWriter out=res.getWriter();

JRHtmlExporter exporter = new JRHtmlExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image=");

exporter.exportReport();

 

In pdf xls and cvs i haven't problems.

thanks

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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