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)
Adding a joined data using BIRT API?
JSdev
I am writing an application that adds two data sets to a rptdesign file. Now I would also like to add a joined data set using full outer join. I have tried:
JointDataSetHandle joint = elementFactory.newJointDataSet("joined");
for (TemplateDataSet ds : templateDataSets) {
String name = ds.getName();
String query = getQueryText(ds.getRowMapping(), ds.getQueryList());
OdaDataSetHandle dataSetHandle = elementFactory.newOdaDataSet( name, "org.eclipse.birt.report.data.oda.xml.dataSet" );
try {
dataSetHandle.setDataSource(DATASOURCE_NAME);
dataSetHandle.setQueryText(query);
template.getDataSets().add(dataSetHandle);
joint.addDataSet(name);
} catch (SemanticException e) {
e.printStackTrace();
}
try {
template.getDataSets().add(joint);
} catch (ContentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NameException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
But when I run this code I get:
The name "joined" duplicates an existing name. Please choose a different name.
But neither of the two previous data sets has that name. Any ideas? And how do I specify to use an full outer join?
Find more posts tagged with
Comments
mwilliams
Hi JSdev,
What happens when you try another name besides "joined"?
JSdev
The same message. I have tried with "joined2" and that gives the same error too.
jrreid
Just a random thought, before you add the new dataset try calling template.rename(joint); and see if that works. I just ran into a similar issue myself and that seemed to fix it.