To solve the issue as discussed, i extended JRXmlDataSource overridden getFieldValue(). It works for all the types of fields with class java.langString. It does not work when i use this fields in the text box having a different type other than java.lang.String. Atleast it didno work with the type i was using (java.io.InputStream). Below is the code for the same. Initially if i return blank string it would throw JRExpressionEvalException.When i return new String(" "), it does not throw any excpetion but does not render the image for me too as in my example. I tried to debug but the code is dynamically generated so i was having diffculty debugging it. Code:public class BIXmlDataSource extends JRXmlDataSource{ /** * <p> * Create a new instance of BIXmlDataSource. * </p> * @param document * @throws JRException */ public BIXmlDataSource( Document document ) throws JRException { super( document ); } public Object getFieldValue(JRField jrField) throws JRException { Object object = super.getFieldValue( jrField ); if(jrField.getValueClassName().equalsIgnoreCase( "java.lang.String" ) && object == null ){ return new String(" "); }else return object; }<image onErrorType="Blank"> <reportElement x="0" y="0" width="55" height="27" isRemoveLineWhenBlank="true"/> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0"/> <leftPen lineWidth="1.0"/> <bottomPen lineWidth="1.0"/> <rightPen lineWidth="1.0"/> </box> <imageExpression class="java.io.InputStream"><![CDATA[new ByteArrayInputStream(Base64Decoder.decode($F{pin-legend}))]]></imageExpression> </image>