dengine = factory.createDesignEngine(dconfig);
// create a new session, open the library, and retrieve the first
// data source since it is uniform in our library
SessionHandle session = dengine.newSessionHandle(ULocale.ENGLISH);
LibraryHandle design = session
.openLibrary("C:/eclipse/GWTBirt/BIRTGwt/src/reports/DataSets.rptlibrary");
dataSourceHandle = (DataSourceHandle) design.getDataSources()
.get(0);
// create a new report
ReportDesignHandle reportDesign = session.createDesign();
reportDesign.getDataSources().add(dataSourceHandle);
// find the correct data set based on dateSetName
int dataSetCount = 0;
for (Iterator dataSetIterator = dataSetNames.iterator(); dataSetIterator
.hasNext();) {
dataSetCount++;
String dataSetName = (String) dataSetIterator.next();
for (Iterator i = design.getDataSets().iterator(); i.hasNext();) {
DataSetHandle dataSetHandle = (DataSetHandle) i.next();
if (dataSetHandle.getName().contains(dataSetName)) {
dataSetHandleToUse = dataSetHandle;