Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Headers and other fields in CSV Generated Report(NOt all headers and other labels are seen in my CSV File)
Headers and other fields in CSV Generated Report [message #1625070] Fri, 20 February 2015 05:59 Go to next message
Nishant Mintri is currently offline Nishant MintriFriend
Messages: 14
Registered: February 2015
Junior Member
Hi ,

I am trying to generate a csv file from the Classical Model . I create my csv file using ICSVDataExtractionOption and IDataExtractionTask .
When i view the CSV file ,I am only able to see the fields that are linked with the dataset elements and not the Header Rows defined in the rptdesign.



Sippets of my code are : -

ICSVDataExtractionOption extractionOptions = new CSVDataExtractionOption();
extractionOptions.setOutputFormat("csv");
extractionOptions.setSeparator(",");
extractionOptions.setOutputStream(output);
IDataExtractionTask iDataExtractTask = (IDataExtractionTask)task;
iDataExtractTask.extract((IExtractionOption)options);

We are using WebLogic 10.3.6 as App server for deploying and Java version is 1.6.

Can anyone explain me , why might this be happening ?

Attached is my rptdesign and an image index.php/fa/20925/0/ of what i want to achieve .
Re: Headers and other fields in CSV Generated Report [message #1630963 is a reply to message #1625070] Mon, 23 February 2015 14:03 Go to previous messageGo to next message
Nishant Mintri is currently offline Nishant MintriFriend
Messages: 14
Registered: February 2015
Junior Member
Does no one have any idea about this issue Sad ???

Re: Headers and other fields in CSV Generated Report [message #1633336 is a reply to message #1630963] Tue, 24 February 2015 20:30 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

I think there have been several responses to this question on here and the BIRT Developer Center. You'll need to create an emitter for CSV, not use the data extraction task. That simply pulls the data from the data set. It doesn't output the report design.

Hope this helps.


Michael

Developer Evangelist, Silanis
Re: Headers and other fields in CSV Generated Report [message #1651637 is a reply to message #1633336] Thu, 05 March 2015 12:18 Go to previous message
Nishant Mintri is currently offline Nishant MintriFriend
Messages: 14
Registered: February 2015
Junior Member
I am using CSVEmitter , yet I do not get the intended result .

This is my code ... Any Help ?

IReportRunnable design = null;
try {
design = BirtEngineHolder.getBIRTEngine().openReportDesign(document.getReportRunnable().getReportName());
} catch (EngineException e) {

e.printStackTrace();
}
IEngineTask task = BirtEngineHolder.getBIRTEngine().createRunAndRenderTask(design);
ObjectOutputStream om = new ObjectOutputStream(new FileOutputStream(myCsVFile));


CSVRenderOption csvOptions = new CSVRenderOption();


csvOptions.setOutputFormat("csv");
csvOptions.setDelimiter(",");
csvOptions.setOutputStream(om);
csvOptions.setShowDatatypeInSecondRow(true);

IRunAndRenderTask runAndRenderTask=(IRunAndRenderTask) task;
runAndRenderTask.setRenderOption((IRenderOption) csvOptions);
runAndRenderTask.setEmitterID("org.eclipse.birt.report.engine.emitter.csv");

runAndRenderTask.run();
Previous Topic:How to generate rptdocument with streaming
Next Topic:Cash when deploy a report that uses a library
Goto Forum:
  


Current Time: Sat Jul 13 15:25:30 GMT 2024

Powered by FUDForum. Page generated in 0.03294 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top