I'm having a problem in OpenEdge Architect. What i want to do is Add a Formula Field to my Report Document at Runtime. To be able to do this i need the "CrystalDecisions.ReportAppServer.ClientDoc" assembly to get to the "ISCDReportClientDocument" interface.
Now the strange thing is when i try to do this in Visual Studio i am able to successfully do this by doing the following:
ReportDocument.ReportClientDocument.DataDefController.FormulaFieldController.AddByName("name", "Text", CrystalDecisions.ReportAppServer.DataDefModel.CrFormulaSyntaxEnum.crFormulaSyntaxCrystal);
Now when i try to so the same in Architect (using the same Assembly dll) by doing the following:
i get the following error "see attached file: error.bmp".
As an example i have made a screen shot containing both the contents of the "ClientDoc" class in Visual Studio and Architect. (see attached file: example.bmp)
So basically my question is: Where is the rest of the class (interfaces) in Architect and why can't i see them?
Any help would be greatly appreciated...
I think that what is happening is that the "ISCDReportClientDocument" interface is using generics. Support for generics is not available in 10.2A. Generic types are not available to the compiler nor the Class Browser.
Assuming that the assembly is included in the assemblies.xml file, you could query the IsGenericType property to see if it is a generic type.
USING Progress.Util.* FROM ASSEMBLY.
DEFINE VARIABLE btnType AS System.Type.
btnType = TypeHelper:GetType( "CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument" ).
A possible workaround would be to have an assembly that performs the code that you want, then use the assembly from the ABL.
Hope this helps,
Thank you for your Reply.
But I'm sorry to say that this is not the case:
Any other suggestions?
In previous post was focused on why the types are not available in the Class Browser.
However, in my environment the Class Browser shows the same classes and interfaces that you have in Visual Studio.
I used version 10.2.3600.0 of the CrystalDecisions.ReportAppServer.ClientDoc. Could there be multiple versions of this assembly?
Could it be that OpenEdge Architect is using a different version of the dll and as such it shows a different list of classes?
I also tested using a variable definition:
DEFINE VARIABLE x AS CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument NO-UNDO.
and it compiled OK.
Somehow, it seems that the assembly is not available to the project (so the OpenEdge runtime would see). (However, the fact your test returned "no" means that the type is actually available to the runtime.)
Is there a reference to the assemblies in the assemblies.xml? Perhaps the assembly was added to the Class Browser but not to the project (Referenced Assemblies in the Resources view or Assemblies page in the project properties).
I hope this helps.
I'm using Crystal Reports 12 (2008) the assemblies are of version 12.0.2000.0
I checked the assembly file and all the assemblies are in place.
Indeed it is available in Runtime and i get all the Enum's and Events from the "CrystalDecisions.ReportAppServer.ClientDoc" class. But is guess the events are useless without the interface. It's strange how you manage to compile successfully with no problem what so ever.
Maybe there's just something wrong on my Development Machine. I will try it on another PC.
Also i have sent this issue to Progress earlier today (because i am really starting to go crazy about this :P )
Can you give me a view on all the other assemblies (versions) you have. Example: The System,System.Drawing and the System.Windows.Forms (mine are .NET 2.0 Version 18.104.22.168727).
My .NET assemblies are version: 22.214.171.124727.3053.
I actually realized that I was not using 10.2A for my testing but 10.2A01.
So, the issue that you described can be seen in 10.2A but not in 10.2A01 since it is fixed.
pray do tell - when is 10.2A01 going to be released ?
I just got word from Progress:
"It seems that you are experiencing bug OE00179554: Classes with ComImport property are filtered out. This bug is scheduled to be fixed in Service Pack 1 for 10.2A, which should be released around April."
So i guess i will have to wait until April to complete my application.
Thank you Edsel for your effort and support!