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

How to remove Image object if no image found?


jigar1276

Recommended Posts

Hi,

I have inserted image in my report. The Image Expression is set as follow:

($F{File_attachment_location}.endsWith(".jpg")||$F{File_attachment_location}.endsWith(".png")||$F{File_attachment_location}.endsWith(".PNG"))?$P{rc_direct_access_url}.validateUNCPath($P{rc_report_author_user_id}, $P{rc_project_id}, $F{revision_id}, $F{File_attachment_location}):null[/code]

Width: 226, Height: 159 is set in the image common property. 

The problem: If image is not found the report displays the blank space covering area of 226 X 159 and then the next record is started. Is there any way I can reduce the number of pages in report while removing the image object if no image is found?

Thanks in advance,

Jigar Baraiya

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

This is the image code:

 

..<image  scaleImage="FillFrame" onErrorType="Blank" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >                    <reportElement                        x="15"                        y="8"                        width="226"                        height="159"                        key="image-3"                        isRemoveLineWhenBlank="true">                            <printWhenExpression><![CDATA[$F{File_attachment_location} != null]]></printWhenExpression>                        </reportElement>                    <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>                    <graphicElement stretchType="NoStretch" pen="None"/>                    <imageExpression class="java.lang.String"><![CDATA[($F{File_attachment_location}.endsWith(".jpg")||$F{File_attachment_location}.endsWith(".png")||$F{File_attachment_location}.endsWith(".PNG"))?$P{rc_direct_access_url}.validateUNCPath($P{rc_report_author_user_id}, $P{rc_project_id}, $F{revision_id}, $F{File_attachment_location}):null]]></imageExpression>                </image>..[/code]

 

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