Jump to content
We've recently updated our Privacy Statement, available here ×

Logo is not getting displayed for PDF report


dolly_11

Recommended Posts

Hi all,

 

Can any one help me out of this issue.I directly displaying the HTML & PDF reports on browser.But i'am getting a problem while displaying the logo on the header portion of Report.The logo's are displayed properly in HTML report but in PDF report it is not displaying the image correctly.Why is it so?

I'am using same .jrxml file for both PDF & HTML reports.......Plzzzzz help me out of this problem.I'm posting this second time as i did'nt get any reply..........

Plz give me reply as soon as possible

regards,

dolly

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi Teodord,

 

I mean the image is getting displayed but instead of the logo it is displaying a strange image (it is displaying some square sought of image with red,green and blue colors inside it).And even the font is coming as bold if it is dynamically generated in browser.But it is displaying the logo correctly in HTML format and even in a PDF report that is being saved on a disk .But I'm getting this image problem only when i want to dynamically generate the PDF report on the browser.The image which i want to display is a GIF image.Can u plzz analyize whtz the problem....

Thanks,

dolly

Post edited by: dolly_11, at: 2007/04/18 03:29

Link to comment
Share on other sites

hi,

 

Below is my <image> element code from jrxml file:

 

<image scaleImage="Clip" onErrorType="Icon" isLazy="true">

<reportElement x="0" y="0" width="40" height="50"/>

<graphicElement stretchType="NoStretch" pen="None" fill="Solid" />

<imageExpression class="java.lang.String">$P{ImagePath}</imageExpression>

</image>

 

As u suggested i have used onErrorType="Error" but it did'nt work.....

 

Thanks,

dolly

Link to comment
Share on other sites

Hi,

 

The image path you pass as parameter is an URL?

Anyway, I asked you to use onErrorType="Error" so that the engine throws an exception if the image could not be loaded during PDF export. Make sure you recompile the report after you modify the JRXML template. And also, make sure you are not catching exceptions and then silently ignore them when you export to PDF.

If there is a problem with the image, then the exception should be somewhere.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

Hi,

 

So as you said on the other thread, you do get an exception telling you that the image was not found at the time of the PDF export.

Since the image has isLazy="true", it means the engine will not make any attempt to load the image at report fill time, but it would be the responsibility of the exporter to deal with the image.

The HTML exporter does not do anything with lazy images. It just puts the URL exactly like it received it, so the browser will load the image from the indicated location, which is most likely a public URL. If you see the image in HTML, it means the browser had access to that URL and was able to load the image.

The PDF exporter, when faced with a lazy loaded image, would try to load the image data from the specified location and embed it into the PDF output. But what if the server that executes your application does not have access to that public URL? Is that the case with your deployment? If your logo is on a public website, does your PDF generating machine has access to that public website?

 

I hope this helps.

Teodor

Link to comment
Share on other sites

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