Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT xml datasouce issue
vlpe
ElementFactory efactory = design.getElementFactory();
OdaDataSourceHandle dataSourceHandle =
efactory.newOdaDataSource("Data Source",
"org.eclipse.birt.report.data.oda.xml");
dataSourceHandle.setProperty("FILELIST", "Z:data.xml");
OdaDataSetHandle dataSetHandle = efactory.newOdaDataSet( "Data Set",
"org.eclipse.birt.report.data.oda.xml.dataSet");
dataSetHandle.setDataSource("Data Source");
dataSetHandle.setQueryText("/root/row");
When exporting to PDF error SEVERE: Cannot prepare statement.
org.eclipse.datatools.connectivity.oda.OdaException: The query text is invalid occurs. Why does this happen and how to resolve the error? Thanks in advance.
Find more posts tagged with
Comments
JasonW
Try something like:
private void createDataSources( ) throws SemanticException
{
OdaDataSourceHandle dataSourceHandle =
elementFactory.newOdaDataSource("Data Source",
"org.eclipse.birt.report.data.oda.xml");
dataSourceHandle.setProperty("FILELIST", "C:/temp/xmltest2.xml");
reportDesignHandle.getDataSources( ).add( dataSourceHandle );
}
private void createDataSets( ) throws SemanticException
{
// Data Set
OdaDataSetHandle dsHandle = elementFactory.newOdaDataSet( "Data Set",
"org.eclipse.birt.report.data.oda.xml.dataSet" );
dsHandle.setDataSource( "Data Source" );
dsHandle.setQueryText(
"table0#-TNAME-#table0#:#[/people/person/name]#:#{name;String;}" );
reportDesignHandle.getDataSets( ).add( dsHandle );
}
Jason