jigar1276 Posted January 30, 2018 Share Posted January 30, 2018 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 More sharing options...
jigar1276 Posted January 30, 2018 Author Share Posted January 30, 2018 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now