0

I need to show an image in my report. It's showing correctly when the image is present in the path given in my image tag. But sometimes the image may not available in the location. In that case i'm getting image not found exception, instead i need to print blank. My code to add image is

<image  scaleImage="FillFrame" vAlign="Top" hAlign="Left" isUsingCache="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                <reportElement
                    mode="Opaque"
                    x="18"
                    y="30"
                    width="125"
                    height="25"
                    forecolor="#000000"
                    backcolor="#FFFFFF"
                    key="image-1"
                    stretchType="NoStretch"
                    positionType="FixRelativeToTop"
                    isPrintRepeatedValues="true"
                    isRemoveLineWhenBlank="true"
                    isPrintInFirstWholeBand="false"
                    isPrintWhenDetailOverflows="false">
                        <printWhenExpression><![CDATA[new Boolean(!$P{signImagePath}.equals(""))]]></printWhenExpression>
                    </reportElement>
                <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>
                <graphicElement stretchType="NoStretch" pen="None" fill="Solid" />
                <imageExpression class="java.lang.String"><![CDATA[$P{signImagePath}+$F{USER_CODE}+".jpg"]]></imageExpression>
jeswin
  • 382
  • 4
  • 9

0 Answers0