Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Dynamic image in table column
Migrateduser
<p>Hi!</p>
<p> </p>
<p>I have an xml datasource with many items with the same type. One item contains simple string attributes and an icon as base64 encoded string.</p>
<p>I've built a table from this item list dataset. Every attribute appears correctly except the image. It is the same for all rows (always the one from the first row).</p>
<p> </p>
<p>I use on create method to decode the base64 string to byte[]:</p>
<div> <cell id="548"></div>
<div> <image id="802"></div>
<div> <property name="dataSet">Transactions</property></div>
<div> <list-property name="boundDataColumns"></div>
<div> <structure></div>
<div> <property name="name">CategoryIcon</property></div>
<div> <expression name="expression" type="javascript">dataSetRow["CategoryIcon"]</expression></div>
<div> <property name="dataType">string</property></div>
<div> </structure></div>
<div> </list-property></div>
<div> <method name="onCreate"><![CDATA[</div>
<div>importPackage(Packages.javax.imageio);</div>
<div>importPackage(Packages.java.io);</div>
<div>importPackage(Packages.org.apache.commons.codec.binary)</div>
<div>importPackage(Packages.java.lang);</div>
<div> </div>
<div>decodedBytes = Base64.decodeBase64(this.getRowData().getColumnValue("CategoryIcon").getBytes());</div>
<div>this.data = decodedBytes;</div>
<div>bais = new ByteArrayInputStream( decodedBytes);</div>
<div>bufimg = ImageIO.read(bais);</div>
<div>this.setHeight(bufimg.getHeight() +"px");</div>
<div>this.setWidth(bufimg.getWidth() +"px");</div>
<div> ]]></method></div>
<div> <property name="source">expr</property></div>
<div> <expression name="valueExpr">row["CategoryIcon"]</expression></div>
<div> </image></div>
<div> </cell></div>
<div> </div>
<div> </div>
<div>Could you help me, what could be the problem?</div>
<div> </div>
<div>My BIRT designer version is: Build id: 20140612-0600</div>
<div>The problem occurs also when I use the template from java code.</div>
<div> </div>
<div> </div>
Find more posts tagged with
Comments
There are no comments yet