Hi,
I am trying to change the datasource of a report originaly pointing on a local xml file by putting another xml data directly in the java code calling the report.
In order to do that, I use the setDataSource(IXMLDataSet arg0, String arg1, String arg2) method which seems to be the right thing to do, but i get an error : "com.crystaldecisions.sdk.occa.report.lib.ReportSDKLogonException: Echec de la connexion.---- Error code:-2147217393 Error code name:dbLogonFailed"
Here is the relevant part of the code :
IXMLDataSet DS = new XMLDataSet();
IByteArray xmlArray = new ByteArray();
IByteArray xmlSchemaArray = new ByteArray();
xmlArray.fromString(XMLData);
xmlSchemaArray.fromString(XMLDataSchema);
DS.setXMLData(xmlArray);
DS.setXMLSchema(xmlSchemaArray);
String tableAlias = reportClientDoc.getDatabaseController().getDatabase().getTables().getTable(0).getAlias();
reportClientDoc.getDatabaseController().setDataSource(DS, tableAlias, "");
The error happens on the setDataSource line.
I have searched on the net for that kind of error with xml datasource, but I didn't find anything. Actually i don't get why the report need logon information to read an xml stream.
Another possibility is maybe the fact that the IByteArray strips XML caracters from the original string.
The last possible thing is maybe that in the 11.8 javadoc, the SetDataSource() method taking IXMLDataSet don't exist, and has been replaced by a method taking collections.
If anybody has ideas on this problem, please tell me.
Thank you,
Guillaume