.NET - Call NotInheritable Class

Osborne

Active Member
I have no experience with NotInheritable Classes so cannot answer that part, but the version of Spire.Xls found here works fine with Progress:


When you say it does not work what error message are you getting?
 

Osborne

Active Member
If this is the message then it means your Progress session is not seeing/knows nothing of the relevant component:
Invalid datatype specified: Spire.Xls.Workbook. Specify a datatype such as 'character' or the name of a class. (5638)
** Could not understand line 1. (196)
Try the following:
  1. Place Spire.License.dll and Spire.XLS.dll in the Progress/Project working directory - MESSAGE SESSION:TEMP-DIRECTORY VIEW-AS ALERT-BOX.
  2. As per this site - OpenEdge 11.7 Documentation - add the Spire.XLS.dll via the "Local Assemblies" tab.
  3. Save the assemblies.xml in the same directory as the .dll files and quit Assembly References. You may need to restart the session so these will be picked up.

This should hopefully get you started.
 

balta

Member
I add in startup the assemblies folder.

I add the 2 files in assemblies.xml folder.

1602845183277.png

The files are in the same folder.

The problem is that "WorkBook" is NotInheritable (static, sealed). I cannot call the class.

If using other class (Inheritable) it is Ok.

Can you share the code that works with Progress?

Thanks,
Baltazar
 

Osborne

Active Member
What you have done seems correct, and as per the first two attached images it should work okay.

Where are you getting the NotInheritable information from? As you can see from the last three attached images Progress Developer Studio does not say they are NotInheritable and only seems to have one version of the Workbook constructor.

I just cannot explain why you are having the problem.
 

Attachments

  • SpireXls1.png
    SpireXls1.png
    16.5 KB · Views: 2
  • SpireXls2.png
    SpireXls2.png
    25.9 KB · Views: 2
  • SpireXls3.png
    SpireXls3.png
    22.9 KB · Views: 2
  • SpireXls4.png
    SpireXls4.png
    27.1 KB · Views: 2
  • SpireXls5.png
    SpireXls5.png
    6.9 KB · Views: 2

Osborne

Active Member
Progress 11.7.

That screen is the Class Browser screen in Progress Developer Studio:

1602848946686.png

Expand the relevant project - only available if you have created one - and Referenced Assemblies, right-click the component and select:

1602848584451.png
 

Osborne

Active Member
Yes, version 4.0 of the dll:

1602853331785.png

Really odd that you are not seeing any classes for it. What do get when you run this:
Code:
DEFINE VARIABLE oAssembly AS System.Reflection.Assembly NO-UNDO.

oAssembly = System.Reflection.Assembly:LoadFile("C:\PathToFile\Spire.XLS.dll").

MESSAGE oAssembly:FullName SKIP
        oAssembly:PermissionSet SKIP
        oAssembly:SecurityRuleSet SKIP
        oAssembly:IsFullyTrusted SKIP
        oAssembly:ReflectionOnly
        VIEW-AS ALERT-BOX.
I get:

1602855102739.png
 

Osborne

Active Member
Unfortunately the three dll files are too large to attach but they were downloaded from here and all unblocked:


1603205984455.png

The assemblies.xml file is blocked from sending so have changed to text to show you how it looks.

The start-up parameters for the shortcut are very simple:

Target: C:\Progress\OpenEdge11\bin\prowin32.exe
Start in: C:\DotNet\SpireXLS

The three dll's and assemblies.xml are in C:\DotNet\SpireXLS.
 

Attachments

  • Compiles.p
    61 bytes · Views: 1
  • assemblies.txt
    268 bytes · Views: 0
Top