Hello OR world,
Posting this for a colleague.
I've got a C# library which has a method which returns an array of objects CrystalReportParameter below: CrystalReportParameter[] DMTempMethod(string paramName); In the OR class browser (OR 11.2) it shows my method as returning an array as well as showing my object class. However, when trying to assign the array of objects, on calling the method in OR, I get the following error: E_OM0029 Converion error during return.
A data conversion error occurred while returning a value from a procedure or method invocation. The return value could not be converted to the type expected by the calling object.
my OR declaration code is: reportObj = reportLibrary!service; reportParams = ARRAY OF reportLibrary!crystalreportparameter; reportLibrary is the external class library, service is the class holding the methods and crystalreportparameter is the class that has been returned.
my method calling code is: reportParams = reportObj.dmtempmethod('repparm');
I've got another method which just returns a crystalreportparameter object itself and have no issues accessing the object returned. I've tried a simpler method returning an array of strings: string[] stringArrayMethod(string paramName); //C# reportParamss = ARRAY OF StringObject; //OR reportParamss = reportObj.stringarraymethod('repparms'); //OR
I get the same error as above. Therefore, does OR not allow external libraries to return arrays or have I incorrectly defined or called my external library method?
Regards, Jade
|
|
ID0EC |
Hi Jade,
The same question has already been asked by David Menz in the OpenROAD Community forum:
I have replied there, here is a copy of it:
You cannot map a C# array (.NET) directly to an
OpenROAD Array.
As OpenROAD supports COM, there must be a COM interface for your .NET library (which has to be made "COM-visible").
How is the method defined in the according COM
TypeLibrary?
Check using the OLE/COM Viewer (oleview.exe) coming with Visual Studio.
What OpenROAD could actually do is to use a Collection of external objects,
see https://docs.actian.com/openroad/11.2/index.html#page/Programming/How_You_Can_Use_Collections_with_External_Classe.htm
Try some declaration like this:
reportParams = Collection OF reportLibrary!crystalreportparameter;
HTH.
Best regards,
Bodo
Bodo
Bergmann Actian, A Division of HCLSoftware |
GESELLSCHAFTSANGABEN: Actian Germany GmbH | Sitz der Gesellschaft:
Halenreie 42, 22359 Hamburg | Geschäftsführung: Stephen Padgett, Marc Monahan | Handelsregister: Amtsgericht Hamburg | HRB 135991 | USt-IdNr: DE252449897
--
You received this message because you are subscribed to the Google Groups "OpenROAD Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
openroad-user...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/openroad-users/SY6PR01MB7351728A374FCEDEDC6ADD989DD79%40SY6PR01MB7351.ausprd01.prod.outlook.com.