Birt - data from external database
How to connect to external database in a Birt report runned in nuxeo ? Definitions included in *.rptdesign files are ignored and BirtEngine connects only to Nuxeo database.
Best regards Adam
0 votes
1 answers
1685 views
In the method getNuxeoReport of the class ReportHelper it should be included:
for (Iterator i = designHandle.getDataSources().iterator(); i.hasNext();) {
OdaDataSourceHandle dsh = (OdaDataSourceHandle) i.next();
(+)OdaDataSource ds = (OdaDataSource) dsh.getElement();
(+)Module root = ds.getRoot();
(+)String odaJndiName = (String) ds.getProperty(root, "odaJndiName");
(+)if (odaJndiName == null || odaJndiName.isEmpty())
(+){
String singleDS = Framework.getProperty(
"nuxeo.db.singleDataSource", null);
if (singleDS != null && !singleDS.isEmpty()) {
(-)OdaDataSource ds = (OdaDataSource) dsh.getElement();
This code checks if there is the “odaJndiName” property in a report and use it. Otherwise, it runs as usual.
All the best.