Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
CSV extraction?
hseeram
I am using BIRT2.3.2.
I wrote the following code to export the results int CSV format. The following code works fine. I do see the CSV file created. However, in the CSV output file I see "’z" charecters added randomly.
Any idea why it is printing the these chars and any suggestions how to remove these chars?
Code:
try {
IReportRunnable design = engine.openReportDesign(rptdesign);
task = engine.createRunTask(design);
((IRunTask) task).run(outrptdocument);
IReportDocument rptdoc = engine.openReportDocument(outrptdocument);
IDataExtractionTask iDataExtract = engine.createDataExtractionTask(rptdoc);
ArrayList resultSetList = (ArrayList) iDataExtract.getResultSetList();
IResultSetItem resultItem = null;
resultItem = (IResultSetItem)iDataExtract.getResultSetList().get(0);
String dispName = resultItem.getResultSetName( );
iDataExtract.selectResultSet(dispName);
out = new ObjectOutputStream(new FileOutputStream(cvsFile));
ICSVDataExtractionOption extractionOptions = new
CSVDataExtractionOption();
extractionOptions.setOutputFile(cvsFile.getAbsolutePath());
extractionOptions.setOutputFormat("csv");
extractionOptions.setSeparator(",");
extractionOptions.setOutputStream(out);
iDataExtract.extract(extractionOptions);
} catch (EngineException e) {
System.out.println(e);
} finally {
if (task != null) {
task.close();
}
if (out != null) {
out.close();
}
}
Thanks
Hari
Find more posts tagged with
Comments
There are no comments yet