+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

OpenEdgeDataProvider

I am using the OpenEdgeDataProvider. I have a PDS defined as follows.

DEFINE DATASET dsPurchaseOrder FOR ttblPurchaseOrder, ttblPoLine, eBusiness, eStore, eVendor
DATA-RELATION ttblPurchaseOrder2ttblPoLine FOR ttblPurchaseOrder, ttblPoLine
RELATION-FIELDS (OrderNum,OrderNum,SeqNum,SeqNum)

Once I populate this PDS I then use the code below but the relation does not come over into LL. I tried using the LL:DataMember and setting to “ttblPurchaseOrder” but then I do not see ttblPoLine.

What am I missing?

oProvider = NEW OpenEdgeDataProvider ().
oDatasetService = NEW OpenEdgeDatasetService (iphDataset).
oDatasetService:TablePrefixToRemove = “e”.
oProvider:ServiceName = oDatasetService:ServiceName.
oProvider:ServiceAdapter = NEW OpenEdgeDatasetServiceAdapter (oDatasetService).
oProvider:Initialize().

The DataProvider registers relations with ListLabel.OpenEdgeAdapter.OpenEdgeSchema.cls

It needs to know who’s the parent of a relation and who’s the child.
The parent is the one that has a unique index on the relation fields. ( Same for database tables).
So in your case this unique index may be missing in your ttblPurchaseOrder.

This code worked for me (LL26).

USING TasteITConsulting.Reporting.OpenEdgeDataProvider FROM ASSEMBLY.
USING combit.Reporting.ListLabel FROM ASSEMBLY.
USING ListLabel.OpenEdgeAdapter.OpenEdgeDatasetService FROM PROPATH.
USING ListLabel.OpenEdgeAdapter.OpenEdgeDatasetServiceAdapter FROM PROPATH.

/* A parent table in a relation needs to have a unique key on the relation-fields.*/
DEFINE TEMP-TABLE ttblPurchaseOrder NO-UNDO
FIELD OrderNum AS INTEGER
FIELD SeqNum AS INTEGER
INDEX pk IS PRIMARY UNIQUE OrderNum SeqNum.

DEFINE TEMP-TABLE ttblPoLine NO-UNDO
FIELD OrderNum AS INTEGER
FIELD SeqNum AS INTEGER
FIELD LineNum AS INTEGER
INDEX pk IS PRIMARY UNIQUE OrderNum SeqNum LineNum.

DEFINE DATASET dsPurchaseOrder FOR ttblPurchaseOrder, ttblPoLine
DATA-RELATION ttblPurchaseOrder2ttblPoLine FOR ttblPurchaseOrder, ttblPoLine
RELATION-FIELDS (OrderNum,OrderNum,SeqNum,SeqNum).

DEFINE VARIABLE oProvider AS OpenEdgeDataProvider NO-UNDO.
DEFINE VARIABLE oDatasetService AS OpenEdgeDatasetService NO-UNDO.
DEFINE VARIABLE oLL AS ListLabel NO-UNDO.

oProvider = NEW OpenEdgeDataProvider ().
oDatasetService = NEW OpenEdgeDatasetService (DATASET dsPurchaseOrder:HANDLE).
oProvider:ServiceName = oDatasetService:ServiceName.
oProvider:ServiceAdapter = NEW OpenEdgeDatasetServiceAdapter (oDatasetService).
oProvider:Initialize().

oLL = NEW ListLabel().
oLL:DataSource = oProvider.
oLL:ForceSingleThread = TRUE.
oLL:Design().

oLL:Dispose().
oProvider:Dispose().

That is odd as your code is exactly the same as mine except I am using LL24.

I will try using LL26.

Thomas,

I downloaded LL26 and then the latest OpenEdgeDataProvider from your site. The BETA version download for LL26 still says v 25. Is this correct?

Hi Roger,

the code is not on my website yet. But you can use everything from the LL distribution. It’s the same I have except some more samples (that are also in LL24 - L25).
I will update my website soon.

Regarding your problem: That the relation is missing is not a problem of DP code (C#, ABL) it’s because of the - probably - missing unique index on the po. Have you checked this?

If you decide to use LL26 please also have a look at this here OpenEdge DataProvider Bug in LL26

You can also send me your entire dataset (via email) and I can have a look at it and try it locally.

Best regards,
Thomas

I have the ABL code from the LL distribution. I was referring to the TasteITConsulting.ListLabel dll.

I do have unique indexes on my TT.

I found the assembly embedded in the LL samples folder…thanks

:+1:

Then it should work. Otherwise send me the dataset.

Any idea why the OpenEdgeService.cls would not compile with error “Could not find class or interface ListLabel.OpenEdgeAdapter.OpenEdgeCalculatedTableArgs”

image

I don’t even see this listed in the classbrowser.

If that class should be distributed with the LL distribution it is not. I grabbed the one had from before.

The LL 26 Data Provider full source code (ABL, C#) is now available on my website.
https://www.taste-consulting.de/downloads/

1 Like

Thanks Thomas. This is now working great.

1 Like

Perfect! I couldn’t imagine it wouldn’t work because it always works for me.

© combit GmbH