Load Base64 image inside detail band, not showing


I am unable to load a base64 image in the detail band, even if the variable containing the base64 string has reset type "Page".

Please resolve. Below are the JRXML snippets:

<variable name="Diamond_Green" class="java.lang.String" resetType="Page">
<band height="355" splitType="Stretch">
<reportElement x="230" y="-3" width="90" height="17" uuid="242bc563-bec7-4f82-9a36-09149de95fef"/>
<textElement textAlignment="Right" verticalAlignment="Bottom">
<font fontName="VoyaArial" size="10" isBold="true"/>
<text><![CDATA[Overall Status]]></text>
<image evaluationTime="Page">
<reportElement x="327" y="-1" width="16" height="16" uuid="2bc38b1a-1503-4c5d-a65c-9e46f7f81870">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<graphicElement fill="Solid"/>
<imageExpression><![CDATA[new ByteArrayInputStream(Base64.decodeBase64($V{Diamond_Green}.getBytes()))]]></imageExpression>

Please let me know what evaluation time/reset type combination I should use.

Thanks for the help.

deepak.sarangi's picture
Joined: Jun 17 2015 - 10:34am
Last seen: 5 years 1 month ago
Hello my friend, I'm in the same situation. Could you solvented this ? Thanks for all.
dcdacd - 5 years 11 months ago

1 Answer:

In this case keep the <initialValueExpression/> as it is, and set the <valueExpression /> of the variable with the same value as in <initialValueExpression/>.

The evaluation time of the image element could be left as "Page". Other appropriate values for the evaluation time are "Now" and "Auto".



shertage's picture
Joined: Sep 26 2006 - 8:06pm
Last seen: 7 months 2 weeks ago