Selecting Right Record (Row) From Connected Excel Database
Hi,
I've tried to find anything regarding this topic on the Forum but have not seen anything that would solve my problem.
I'm retrieving data from an excel sheet based on the data given by our ERP system. Our ERP generates a text file which pinpoints what product label and values that should be printed and the data is then picked out of the excel file. This works well in one of our production lines since every "main"-record in the join is unique.
My problem in the other production lines is that the connected excel database from which I am supposed to get our label data has more then one unique "main" product record and the record row should be pinpointed with a second given data field from the generated text file.
In the attached picture you can see the two columns that are problematic. The EB-1-... beeing the "main"-record that tells what product that needs to be printed and L-2-... tells which record row of the product that needs to be chosen. We have over 21k unique EB products and some of them can have up to 100 different record rows depending on the L-2 and the same L-2 can be used in different EB's.
It's impossible to do a two row multi database join with the same text file and sheet since they both use the same databases.
How can I pinpoint which record that should be printed since I have all the data needed for it, given by the product "EB" and the attached device "L-2"?
Br. JP
-
Instead or in addition to a single field join I suggest you make use of a query prompt in your trigger file. This will neccessitate the use of either Commander Script or BarTender XML Script as these allow both data and commands in the trigger file.
0 -
Ok thank you Ian,
Do you have a place on this forum where I can study similar cases, since I haven't used any of these up until now? Is it not possible to write a VBscript for the data source of the L-2 value?
0 -
I don't know. I suggest you try searching.
You could write a VB script to connect to a DB to retrieve the data you want for printing in that data source, although of course this approach will affect performance to some degree.
0 -
I will try searching then.
Thank you for your help though. Seems like I'll have to get this working with some help from your pointers here. Will post a reply when I figure out how to get this printed in this particular case.
0 -
Hi again,
With the help of our local printer hardware and software provider I got it working with VBS-ADODB. The code checks the file for EB and L-2 match and then fetches the records on the specific row to the template. If anyone need help, let me know.
0
请先登录再写评论。
评论
5 条评论