Database variation with SDK

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
Reyu
Newcomer
Posts: 2
Joined: Sat Sep 07, 2019 11:41 am

Database variation with SDK

Post by Reyu » Sun Jan 26, 2020 11:31 am

Hello,

I have a software written in c# to inspect labels. The idea is to go through a few thousand labels and find predefined errors which comes from user error at label editing, errors like specific object on the label is not the correct size or its rotation is wrong, etc.
I made a similar code for Nicelabel 6 with VBA but we upgraded to Nicelabel 2019 and I want to recreate the same app with the SDK.

So my problem is that I have a solution file which contains multiple labels, each label has database connections from an excel file.

I was able to open the solution with PrintEngineFactory.PrintEngine.OpenSolution() and open a specific label inside the solution with
solution.OpenLabel().

But when I create a LabelPreview or try to print the selected label the objects with connected datasources are blank.
How can I tell Nicelabel which record or row I want to use from the connected excel?

The purpose is to be able to save a labelpreview or print the label if I detect an error, since the inspection is automatic and the user can check the label later.

I read through the SDK reference file but I was unnable to find a solution.

Regards,
Reyu

User avatar
Mytch
NiceLabel Support
NiceLabel Support
Posts: 117
Joined: Fri Jul 13, 2018 10:26 pm
Location: Milwaukee, Wisconsin
Contact:

Re: Database variation with SDK

Post by Mytch » Mon Feb 03, 2020 4:51 pm

Reyu,

Easiest way is probably to just use a database filter on the label/solution that is qualified by some variable. This way, when filter is qualified, record is selected and usable in preview/print. Or, depending on how things are configured, you can have some database > variable mapping and make the variable Initial Value the value of the database field (assuming some record is retrieved by default). I don't think there are any native methods in API to help with Excel for this case.

Regards,
Mytch

Post Reply