Jump to content

JPG and GIF are ok but not BMP

Recommended Posts

By: Andy Santosa - andysantosa

JPG and GIF are ok but not BMP

2003-05-19 20:56

I created a employee cv with employee picture in the report and the image setting is



<image scaleImage="RetainShape" vAlign="Top" hAlign="Left" isUsingCache="false" evaluationTime="Now" hyperlinkType="None"> <reportElement













<printWhenExpression><![CDATA[new Boolean($F{iEmployeePicture}!=null)]]></printWhenExpression>


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

<imageExpression class="java.lang.String"><![CDATA[$P{realPath}+$P{imagePath}+$F{iEmployeePicture}]]>



the image is stored in the file, so $F{iEmployeePicture} will contain the name of the file and the two parameter contains the path.

If I put JPG and GIF, the image is shown correctly but not with BMP.


Do you have any idea with this problem ?









By: Teodor Danciu - teodord

RE: JPG and GIF are ok but not BMP

2003-05-20 09:37




In Java, there is no support to work with BMP files by default.

You need a special library to load images from files with

formats other that JPG and GIF.


You can use the Java Advanced Imaging API to if

you need to display BMP images in reports.




In this case, you will load the image yourself by calling

the API and give the report engine a java.awt.Image object for displaying.


I hope this helps.







By: Paulo Soares - psoares33

RE: JPG and GIF are ok but not BMP

2003-05-20 09:47

The last iText version in my site supports BMP directly. It returns a com.lowagie.text.Image that may or may not be usable in JR. Note that just as BMP, there's direct support for all kind of GIF, TIFF and PNG in a way that generates smaller files than using a java.awt.Image. All this for PDF only, of course.

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