Load Base64 image inside detail band, not showing

0

Hi,

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">
<initialValueExpression><![CDATA["iVBORw0KGgoAAAA....X2DAAAAABJRU5ErkJggg=="]]></initialValueExpression>
</variable>
 
<detail>
<band height="355" splitType="Stretch">
<printWhenExpression><![CDATA[Boolean.TRUE]]></printWhenExpression>
<staticText>
<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"/>
</textElement>
<text><![CDATA[Overall Status]]></text>
</staticText>
<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"/>
</reportElement>
<graphicElement fill="Solid"/>
<imageExpression><![CDATA[new ByteArrayInputStream(Base64.decodeBase64($V{Diamond_Green}.getBytes()))]]></imageExpression>
</image>
</band>
</detail>

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: 1 year 10 months ago
Hello my friend, I'm in the same situation. Could you solvented this ? Thanks for all.
dcdacd - 2 years 9 months ago

1 Answer:

1

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

Regards,

Sanda

shertage's picture
1940
Joined: Sep 26 2006 - 8:06pm
Last seen: 1 day 6 hours ago
Feedback
randomness