Skip to main content



      Home
Home » Archived » BIRT » why IdataExtractionTask.getResultSetList( ); rerurns ONLY ONE ResultSet?
why IdataExtractionTask.getResultSetList( ); rerurns ONLY ONE ResultSet? [message #257713] Tue, 09 October 2007 17:16 Go to next message
Eclipse UserFriend
Originally posted by: titaniumcity.yahoo.com

Hi All,

I am working on converting an existing birt reports ( developed by some
other engineer) in to CSV format. These reports have multiple data sources
fecting data from MYSQL DB from diffrent tables and reports have lots of
nested grids/ nested tables with their “own Data Sources”. With this, if
I try to extract the data using IdataExtractionTask.getResultSetList( );
it returns me only one result set item associated to the most outer table
on the birt report. The following code would print ONLY ONE
“ResultSetName ====> G2SpeedDS“!!!! All other nested table Data sources
will not be printed here at all.
So,”ArrayList resultSetList = (ArrayList)dataTask.getResultSetList( );”
would have just one element in it.


The question is how can I get hold of /extract all the data sources or
data on the report?

I appreciate your help.

Thank You
Bob

======= Code snippet =====================
static void extractData(IReportEngine engine, IReportDocument document,
Locale locale ) throws Exception

{

IDataExtractionTask dataTask = null;

IExtractionResults result = null;

IDataIterator iData = null;

try

{

dataTask = engine.createDataExtractionTask( document );

ArrayList resultSetList = (ArrayList)dataTask.getResultSetList( );

int q =0 ;

IResultSetItem resultItem = null;

Iterator it = resultSetList.iterator();

while (it.hasNext()) {

resultItem = (IResultSetItem)it.next();

System.out.println("ResultSetName ====> " +
resultItem.getResultSetName( ));

dataTask.selectResultSet(resultItem.getResultSetName( ));

}


dataTask.selectColumns( columnNames );

dataTask.setLocale( locale );
======= Code snippet ends =====================
Re: why IdataExtractionTask.getResultSetList( ); rerurns ONLY ONE ResultSet? [message #258412 is a reply to message #257713] Mon, 15 October 2007 14:05 Go to previous message
Eclipse UserFriend
Bob,

It looks like you are using the DataExtraction interface, which works on
only one dataset at a time. I believe that what you want to do is use the
Report Emitter interface which works across the entire report. In order
use the ReportEmitter to generate a CSV file you will need to create your
own CSV Emitter using the Emitter API.

There is an example of this in the book Integrating and Extending BIRT, Vol.
2.

Scott Rosenbaum



> ,”ArrayList resultSetList = (ArrayList)dataTask.getResultSetList( );”
> would have just one element in it.
>
> The question is how can I get hold of /extract all the data sources or
> data on the report? I appreciate your help.
>
Previous Topic:Possibility to use only one parameter several times in only one SQL-Stmt?
Next Topic:Running Build Dynamic Table (BIRT) tutorial
Goto Forum:
  


Current Time: Sun Jun 01 16:05:53 EDT 2025

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

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

Back to the top