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

Load Base64 image inside detail band, not showing

Go to solution Solved by szaharia,

Recommended Posts


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.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

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



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