Issue with Error 12886 "Could Not Find Class of Interfa

Posted by Ken Ward on 12-May-2016 11:02

I'm evaluating a third party .net library called DynamicPDF.

http://www.dynamicpdf.com/Support/NET_Help_Library_16_03/?DynamicPDF%20Generator%20for%20.NET.html#ceTe.DynamicPDF~ceTe.DynamicPDF.PageElements_namespace.html


The problem I'm having is the behavior of Progress with regard to whether or not it sees certain classes within the same library.


Here's some basic example code.


USING ceTe.DynamicPDF.PageElements.*.
USING ceTe.DynamicPDF.*.

DEF VAR myDocument AS Document NO-UNDO.
DEF VAR myPage AS Page NO-UNDO.

       
myDocument = NEW Document().
myPage = NEW Page().       


myPage:Elements:Add(NEW Label("Hello World!", 0, 0, 100, 12, Font:Helvetica, 12)).


MyDocument:Pages:Add(myPage).
MyDocument:Draw("d:\User\ken\hello.pdf").


This could be dropped into an empty .p and run (assuming the assemblies.xml is setup properly):

This code works and produces a simple PDF with the words "Hello World!" on it.

Now, if I replace the Label with a Line like this:

MyPage:Elements:add(NEW Line(72, 72, 144, 144)).

I get the following Errors.

Could not find class or interface Line. (12886)
Could not locate method 'add' with matching signature in class
'ceTe.DynamicPDF.PageElements.Group'. (14457)
** Could not understand line 12. (196)

The full Namespace for Label (which works) is ceTe.DynamicPDF.PageElements.Label and Line is ceTe.DynamicPDF.pageElements.Line.

Why does Progress see Label but not Line?

I have tried to surround Line with quotes and I've tried putting the entire namespace in, it still errors.

If there was a problem with my assemblies.xml, then Label shouldn't work either.

All Replies

Posted by Laura Stern on 12-May-2016 12:33

Your assumptions all seem correct.  I don't see any reason this shouldn't work.  

Try qualfying "Line" in-line and see if that works.  i.e.,

MyPage:Elements:add(NEW ceTe.DynamicPDF.pageElements.Line(72, 72, 144, 144)).

Try it w/ and w/o fully qualfied name in a separate statement: e.g.,

DEFINE VAR elemLine AS ceTe.DynamicPDF.pageElements.Line.

elemLine = NEW ceTe.DynamicPDF.pageElements.Line(72, 72, 144, 144).

elemLine = NEW Line(72, 72, 144, 144).

etc. If any of those work, it is a bug that the original code did not.

Otherwise, ... I don't know.  You'd have to log a bug so we can investigate.

Posted by Ken Ward on 12-May-2016 14:33

Thank you fro your response. I figured it out eventually. I didn't realize that Progress enforced Case Sensitivity in the names of .NET classes.

Since line is a keyword, AppBuilder was capitalizing it. I had to use the quotes so that AB wouldn't do that.

So it should have been "Line" not LINE.

Posted by Mike Fechner on 12-May-2016 14:36

Instead of quoting "Line" you can also start typing xLine followed by space and then remove the leading X.

Posted by Laura Stern on 12-May-2016 14:40

Yes, I thought of that, but you didn't show LINE in your example. Showing "Line" was wishful thinking on your part :-0

Anyway - yes.  .NET is case sensitive and for the first reference to a class, we need to rely on .NET to resolve it.  After that, we have obtained the type information for all the methods/properties, etc. of the class, including of course the class's name.  So thereafter, we can look things up locally and do it case independently.  

Frankly, I wonder if that wasn't a mistake on our part.  It lulls people into being careless and then they forget.  Not directed at you - just a general observation.

Posted by bernhardkraml on 04-Apr-2018 01:52

Hello Ken,

I found your thread regarding DynamicPDF.

I'm just evaluating this tool.

Can you tell me, what are the pitfalls with this?

Find you this  usefull?

Can you give me some tips fpr using this .Net-Library with OpenEdge.

I'm using OE 11.7.2

Thanks

-bernhard

This thread is closed