Home
Analytics
Birt Excel Export
MALPI
Hi,<br />
<br />
i have written a ReportEngine with BirtRuntime 3.7. Because we are also creating charts, I used the Tribix Emitter for BIRT.<br />
<br />
The problem is, that the Output that Birt creates is totally unreadable. At the moment, I am using the HSSF API to formate all tables and charts that are created. But it would be the better way if the output is well formatted.<br />
<br />
I know that it isnt the best choice to do the output in xls format, that was not my decision....<br />
<br />
There is an Excel File in Attachment, produced by BIRT.<br />
<br />
My Engineconfig is the following:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
try{
EngineConfig config = new EngineConfig();
Map<String, Boolean> xlsConfig = new HashMap<String, Boolean>( );
// Check out constants in XlsEmitterConfig.java for more configuration detail.
xlsConfig.put(XlsEmitterConfig.KEY_REMOVE_EMPTY_ROW, true);
config.setEmitterConfiguration("xls", xlsConfig);
config.setLogConfig(enginePath+"/log/", Level.SEVERE);
try{
Platform.startup(config);
logger.info("Platform gestartet.");
}catch(Exception e){
System.exit(2);
logger.error(e.getMessage());
}
/*
*Here is Code for Loading Designfiles and so on, but nothing with configuring
*/
EXCELRenderOption options = new EXCELRenderOption();
options.setOutputFormat("xls");
options.setOutputFileName(output+".xls");
//Setzen eines externen ExcelEmitters um mehrere Sheets erzeugen zu k?nnen
options.setOption(IRenderOption.EMITTER_ID, "org.uguess.birt.report.engine.emitter.xls");
//Renderauftrag ausf?hren
logger.info("Renderauftrag wird ausgef?hrt");
IReportRunnable document = engine.openReportDesign(file);
IRunAndRenderTask task = engine.createRunAndRenderTask(document);
logger.info("Rendertask erstellt");
//Setzen der Parameter des Designs, falls welche ?bergeben wurden.
if(startDate != null && endDate != null){
task.setParameterValue("RP_startDate", startDate);
task.setParameterValue("RP_endDate", endDate);
task.validateParameters();
}
task.setRenderOption(options);
task.run();
task.close();
logger.info("Dokument " +file +" generiert.");
}
</pre>
<br />
I also attached the Designfile but removed the Data Source...<br />
<br />
Maybe somebody can give me a hint.<br />
<br />
Cheers...
Find more posts tagged with
Comments
Yaytay
That's pretty much why I wrote my emitters.
http://www.spudsoft.co.uk/2011/10/the-spudsoft-birt-excel-emitters/
I also went through the hassle of trying to clean up the Tribix spreadsheets using POI, but then I found that some crosstabs couldn't be cleaned up.
There are also other third party emitters, but I think SpudSoft and Tribix are the only free ones that support images, Arctorus doesn't cost much and you should try that too.
MALPI
Hi Yaytay,
Thanks for answering. I was worried about that I could do something wrong.
Cheers,
MALPI
jeffmor
Hi,
There are 2 examples generated with our Arctorus Xlsx emitter.
wbs_arc_landscape.xlsx - page orientation changed to Landscape. Looks better than Tribix but also not perfect.
wbs_arc_custom_width.xlsx - page width is 20 inches.
Both reports exported without datasource.
Regards, Jeff
MALPI
Hi Jeff,
Thanks for that.
The file with fix page width, does look much better.
Can I also Export Pictures with Arctorus Xlsx emitter?
Cheers,
MALPI
jeffmor
Sure, you can. The only problem is Arctorus emitters export all data field to excel as text but all excel types should be implemented before Christmas. We are working also on editable excel charts but at the moment I don't have any estimations yet.
Jeff
Yaytay
Oh, are we getting competitive now?
Attached is the output from the SpudSoft emitter with no changes.
Hmm, I thought this would be an easy win for me, but I still have to explain a few points:
1. I don't do wrapping based on text size - if you put newlines in your text I'll resize the row so it fits, but I don't do what Arctorus does with your headings.
2. Because you haven't specified any column widths your table is eligible for auto col widths, but I calculate those purely on data row (not header) so they don't work when there is no data.
If you have long headings and small data I can also rotate the headings
, but that needs a custom UserProperty.
And yes, charts can be output with my emitters
.
Jim
MALPI
<blockquote class='ipsBlockquote' data-author="'Yaytay'" data-cid="86683" data-time="1322815305" data-date="02 December 2011 - 01:41 AM"><p>
Oh, are we getting competitive now?
<br />
<br />
Attached is the output from the SpudSoft emitter with no changes.<br />
<br />
Hmm, I thought this would be an easy win for me, but I still have to explain a few points:<br />
1. I don't do wrapping based on text size - if you put newlines in your text I'll resize the row so it fits, but I don't do what Arctorus does with your headings.<br />
2. Because you haven't specified any column widths your table is eligible for auto col widths, but I calculate those purely on data row (not header) so they don't work when there is no data.<br />
If you have long headings and small data I can also rotate the headings
, but that needs a custom UserProperty.<br />
<br />
And yes, charts can be output with my emitters
.<br />
<br />
Jim<br /></p></blockquote>
<br />
Hey,<br />
<br />
I tried to Export Charts, this didn't work. I already tried your Emitter and I am really satisfied with the produced output. But I also need the support for Charts.
The produced xls File is Empty.<br />
<br />
MALPI
Yaytay
<blockquote class='ipsBlockquote' data-author="'jeffmor'" data-cid="86682" data-time="1322815219" data-date="02 December 2011 - 01:40 AM"><p>
The only problem is Arctorus emitters export all data field to excel as text but all excel types should be implemented before Christmas.<br /></p></blockquote>
Well that's a win for me (at least until Christmas
) - having the correctly typed cells in Excel is vital if the spreadsheet is going to be used as a spreadsheet.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'jeffmor'" data-cid="86682" data-time="1322815219" data-date="02 December 2011 - 01:40 AM"><p>
We are working also on editable excel charts but at the moment I don't have any estimations yet.<br /></p></blockquote>
Ooh, now that'll be quite a convincing win for Arctorus when they get it right. Not easy to do, you have to go back to the report design and map all the features of BIRT charts to Excel ones.<br />
The POI library that I use doesn't even have chart creation yet
(charts are just images at the moment) <br />
<br />
Are you going to support that on XLS and XLSX?<br />
<br />
Jim
Yaytay
<blockquote class='ipsBlockquote' data-author="'MALPI'" data-cid="86700" data-time="1322815665" data-date="02 December 2011 - 01:47 AM"><p>
The produced xls File is Empty.<br /></p></blockquote>
Well that's no good!<br />
<br />
Can you attach a report with a chart and some way for me to access data so I can try it?<br />
<br />
I've attached a copy of my output of the CustomerOrdersFinal sample report so you can see a chart from my emitter.<br />
It's not a very good report for my emitter because they've set Page Break Interval on the tables, much better to set that to 0 and get everything in one place.<br />
It also shows up the limitations (strengths) of my emitter, cell A2 would be better merged over to G2, but I don't make merge assumptions - if you want it merged over six columns create a grid with six columns in BIRT and merge them into one.<br />
<br />
What version of BIRT and my emitter are you using?<br />
This attachment was 3.7.1 and 0.4.0.
jeffmor
<blockquote class='ipsBlockquote' data-author="'Yaytay'" data-cid="86721" data-time="1322816062" data-date="02 December 2011 - 01:54 AM"><p>
Are you going to support that on XLS and XLSX?<br /></p></blockquote>
<br />
Planning to support both XLS and XLSX although XLS is another story.<br />
<br />
Jeff
MALPI
Hey,
Thanks for this great discussion. ;-)
I have talked with my team. At the end we pointed out that we won't use other Emitters at the moment. But it's good to know that it isn't my fault. ;-)
MALPI