Crystal Reports 12 / .NET (.cls)

Posted by Admin on 02-Mar-2009 08:30

Hello,

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:

ReportDocument1:ReportClientDocument:DataDefController:FormulaFieldController:AddByName('name','text',CrystalDecisions.ReportAppServer.DataDefModel.CrFormulaSyntaxEnum:crFormulaSyntaxCrystal).

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...

Niels

error.bmp

example.bmp

All Replies

Posted by egarcia on 03-Mar-2009 11:04

Hello Niels,

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.

Example:

USING Progress.Util.* FROM ASSEMBLY.

DEFINE VARIABLE btnType AS System.Type.

btnType = TypeHelper:GetType( "CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument" ).

MESSAGE btnType:IsGenericType.

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,

Edsel

Posted by Admin on 04-Mar-2009 02:25

.

Posted by Admin on 04-Mar-2009 05:16

Thank you for your Reply.

But I'm sorry to say that this is not the case:

MESSAGE btnType:IsGenericType.

Returned "no".

Any other suggestions?

Posted by egarcia on 04-Mar-2009 14:43

Hello Niels,

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.

Edsel

Posted by Admin on 05-Mar-2009 07:53

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 )

Niels

BTW:

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 2.0.0.50727).

Posted by egarcia on 05-Mar-2009 10:25

Hello Niels,

My .NET assemblies are version: 2.0.0.50727.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.

Regards,

Edsel

Posted by jmls on 05-Mar-2009 11:17

pray do tell - when is 10.2A01 going to be released ?

...

Posted by Admin on 06-Mar-2009 02:16

Hi guys,

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!

This thread is closed