Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT 4.3.2 excel emitter images not displayed
bhairavchampawat
<p>Hi,</p><p> </p><p>I am trying to use</p><p>uk.co.spudsoft.birt.emitters.excel.XlsxEmitter</p><p>with birt runtime 4.3.2 and I am facing 2 issues.</p><p> </p><p>1. I am unable to see images in the excel output. Can see them correctly in the pdf output generated from same design file.</p><p>2. The table formatting goes for a toss in the excel output. Again pdf output looks perfect.</p><p> </p><p>Below is an extract from the design file.</p><p> </p><p><image id="106"></p><p><property name="height">0.8333333333333334in</property></p><p><property name="width">8.4375in</property></p><p><property name="source">file</property></p><p><expression name="<span class='bbc_underline'>uri</span>" type="constant">report/images/Header.bmp</expression></p><p></image></p><p> </p><p>Can anyone help me out here?</p><p> </p><p>Regards.</p><p> </p>
Find more posts tagged with
Comments
mwilliams
<p>Are you using Java or the Web Viewer? If Java, can you show the Java you're using to output to XLS? Let me know.</p>
bhairavchampawat
<p>I am using Java<br><br>
</p>
<p> </p>
<p><b>private</b> <b>byte</b>[] generateExcelReport(IRenderTask renderTask, String excelPath)</p>
<p> </p>
<p><b>throws</b> EngineException, IOException {</p>
<p> </p>
<p><b>byte</b>[] reportData=<b>null</b>;</p>
<p>EXCELRenderOption exceloptions = </p>
<p><b>new</b> EXCELRenderOption(); </p>
<p>ByteArrayOutputStream byteArrayOutputStream = </p>
<p><b>new</b> ByteArrayOutputStream();</p>
<p>exceloptions.setOutputStream(byteArrayOutputStream);</p>
<p>exceloptions.setOutputFormat(</p>
<p>"xlsx");</p>
<p>exceloptions.setOption(</p>
<p>"ExcelEmitter.ExtractMode",Boolean.<i>TRUE</i> );</p>
<p>exceloptions.setOption(</p>
<p>"ExcelEmitter.NoStyles",Boolean.<i>TRUE</i> );</p>
<p>exceloptions.setOption(IRenderOption.</p>
<p><i>HTML_PAGINATION</i>, Boolean.<i>FALSE</i> );</p>
<p>exceloptions.setOption( </p>
<p>"ExcelEmitter.DEBUG", Boolean.<i>TRUE</i>);</p>
<p>exceloptions.setOption(</p>
<p>"ExcelEmitter.RemoveBlankRows", Boolean.<i>TRUE</i>);</p>
<p>exceloptions.setOption(</p>
<p>"ExcelEmitter.SingleSheet", Boolean.<i>TRUE</i>);</p>
<p>exceloptions.setOption(</p>
<p>"ExcelEmitter.DisplayGridLines", Boolean.<i>FALSE</i>);</p>
<p>exceloptions.setHideGridlines(</p>
<p><b>true</b>);</p>
<p>exceloptions.setOption(</p>
<p>"ExcelEmitter.DisplayRowColHeadings", Boolean.<i>FALSE</i>);</p>
<p>exceloptions.setOption(</p>
<p>"ExcelEmitter.DisplayZeros", Boolean.<i>TRUE</i>);</p>
<p>exceloptions.setOption(IExcelRenderOption.</p>
<p><i>OFFICE_VERSION</i>, "office2007");</p>
<p>exceloptions.setOption(IRenderOption.</p>
<p><i>EMITTER_ID</i>,</p>
<p> </p>
<p>"uk.co.spudsoft.birt.emitters.excel.XlsxEmitter");</p>
<p>renderTask.setRenderOption(exceloptions);</p>
<p>renderTask.render();</p>
<p> </p>
<p><b>if</b>( <b>null</b>!=excelPath){</p>
<p>OutputStream outputStream =</p>
<p><b>null</b>;</p>
<p> </p>
<p><b>try</b>{</p>
<p>outputStream = </p>
<p><b>new</b> FileOutputStream (excelPath);</p>
<p>byteArrayOutputStream.writeTo(outputStream); </p>
<p>} </p>
<p><b>catch</b>(Exception e){</p>
<p> </p>
<p><i>s_log</i>.warn(String.<i>format</i>("Error writing file into path ",excelPath));</p>
<p>} </p>
<p><b>finally</b> {</p>
<p>outputStream.close();</p>
<p>}</p>
<p>}</p>
<p>reportData=byteArrayOutputStream.toByteArray();</p>
<p> </p>
<p>byteArrayOutputStream.close();</p>
<p> </p>
<p><b>return</b> reportData;</p>
<p>}</p>
bhairavchampawat
<p>Also the several Excel options I am using do not work. I am specifically interested in switching off the gridlines, but am unable to do so with the above code.</p>