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)
Images are not coming in excel reports?
rohitmali
Hi,<br />
<br />
I am using Birt reports. I created the excel reports but <strong class='bbc'>problem is that images are not exported in excel reports</strong>, images are coming properly in PDF reports.<br />
<br />
Thanks.
Find more posts tagged with
Comments
Yaytay
This is a copy of my answer to your other posting
<br />
<br />
The built-in Excel emitter is rather limited:<br />
<ul class='bbc'><li>It doesn't do multiple sheets.</li><li>It doesn't do images (or charts).</li><li>It doesn't even output a proper XLS or XLSX file.</li></ul>
<br />
The only way around these limitations is to use a different emitter.<br />
<br />
Fortunately there are quite a few Excel emitters, <a class='bbc_url' href='
http://www.spudsoft.co.uk/2011/10/the-spudsoft-birt-excel-emitters/'>this
blog posting</a> lists all those I'm aware of and gives details of the <a class='bbc_url' href='
https://bitbucket.org/yaytay/spudsoft-birt-excel-emitters/downloads'>SpudSoft
Excel emitters</a> that I wrote.<br />
<br />
These blog posts might also be of use:<br />
<ul class='bbc'><li>
http://birtworld.blogspot.com/2010/06/birt-excel-output.html</li><li>http://birtworld.blogspot.com/2011/06/birt-37-released.html</li><li>http://birtworld.blogspot.com/2011/07/replacing-default-birt-xls-emitter.html</li></ul>
;
Note that they recommend the Tribix emitter (I think it was the first third party Excel emmitter), but I would avoid using that if (and only if) you actually want to manipulate the output as spreadsheets afterwards (Tribix achieves very high-fidelity output by creating a lot of extra rows and columns to line things up - with the result that numbers that ought to be in the same column are sometimes not).<br />
<br />
Jim
rohitmali
Thanks
rohitmali
Hi Jim, <br />
<br />
Following is my code snippet to generate the excel report.<br />
Now I am using your .jar.<br />
<br />
I have some doubts,<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>public EXCELRenderOption generateExcelReport()
{
EXCELRenderOption options = new EXCELRenderOption();
// set output option
options.setOption("fixed_column_width", true);
options.setHideGridlines(false);
options.setWrappingText(true);
options.setEnableMultipleSheet(true);
options.setEmitterID("org.eclipse.birt.report.engine.emitter.prototype.excel");
//options.setEmitterID("org.uguess.birt.report.engine.emitter.xls");
//options.setOption(IRenderOption.EMITTER_ID, "org.uguess.birt.report.engine.emitter.xls");
//options.setOutputFormat(EXCELRenderOption.OPTION_MULTIPLE_SHEET);
options.setOutputFormat("xls");
return options;
}
</pre>
In above code, I had used the <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
options.setEmitterID("org.eclipse.birt.report.engine.emitter.prototype.excel");
</pre>
what should I use for Emitter Id if I am using <span class='bbc_underline'><strong class='bbc'>SpudSoft Excel emitters</strong></span> which you mentioned in your reply?
Yaytay
Sorry, try one of these:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if( "XLS".equalsIgnoreCase( outputFileFormat ) ) {
renderOption.setEmitterID( "uk.co.spudsoft.birt.emitters.excel.XlsEmitter" );
} else if( "XLSX".equalsIgnoreCase( outputFileFormat ) ) {
renderOption.setEmitterID( "uk.co.spudsoft.birt.emitters.excel.XlsxEmitter" );
}
</pre>
<br />
Jim