Database + Table Integration
I have an integration where a .BT file is created from EpicorERP and dropped on the BarTender server. This file has the necessary BT header info for an integration as well as the data. This data is for Package Control PCID. When a user prints a label it shows the contents/Qty in a particular box. My goal was to populate a table that will "grow" up to 5 rows per lable. In the ERP we were planning to limit the contents of a box to 5 unique UPC codes for a 2x4 label. In other words we should never try to print a label with more than 5 records I figured a 2x2 table where the left column is UPC and Right column is QTY. If there is only 1 UPC for this box then only 1 row will populate. If there are 5 then 5 rows will populate. In any case these rows should all be in the same single label. If you looked at the raw .bt file you would see 5 rows if there were 5 UPCs added. I successfully added the data to a table and saw the results I was looking for when I preview it. However when I ran the integration it failed with "Database "" with type "TextFile" is not found. Please check you documents database connection." I was told this was because I did not setup a database connection. I proceeded to create a database connect to the same sample file that then the point the table to the database. This auto printed but rather than unique UPCs on 1 labe I got 5 labels with the same UPC on each.
-
Peter Thane
★ BarTender Hero ★
So it sounds like you have a trigger file with the label commands at the top, between the %BTW% and %END% "brackets" plus then up to 5 lines of data.
If that is correct you need to configure the integration to save the trigger file to be used as the database file for the label with the label set to records per label as 5 and the 5 UPC set to link to UPC_1, UPC_2 etc. and then repeated for the 5 QTY values.
In the trigger file the /R=3 command should be removed as all you want the Integration to do is print the label, letting the label control where the data is coming from rather than using the /R command. The Integration would need to be set to rename and save the file when it triggers replacing any existing file.
0 -
Matthew Garitta
★ BarTender Hero ★
Hey Peter
So the the *.bt output file created from EpicorERP has the header you referenced, followed by all the records/data required for the label. The data/records are all related to the same label(s) intended for the outside of a given box. At the moment all I care about is Part/UPC and Quantity. I was recently told that a given label(s) may need more than 5 UPCs. In other words they may put more than 5 different parts in the same box. As a result (for readability) I may need to print more than 1 2x4 label with at most 5 UPC for each box. So if the user hits print and they added 8 UPCs to a box I print 1 label with 5 UPCs and 1 with 3 and put them on the outside of the same box. The *.bt file in this case would only have 8 records.
From what you are saying I would have to grab the file in the integration builder and replace the /R=3 with "nothing" before the print command?
Then I should be able to use it as a datasource for the table? Right now the only way I "sort of" got it working was to use the same "sample file" as a database connection as well as "data source" for the table. This prints labels automatically....but it was the same data duplicated against X number of labels were X is the number of rows in data. So if it was 5 records I would get a label with 5 UPCs but the same label would print 5 times. In addition to that it appears to not pull new data? I thought a ran a new file with new UPC but when it auto printed it appears to have same data from the sample file.
%BTW% /AF="\\colt-bartender\BarTender\Reports\BT-PCID.btw" /D="<Trigger File Name>" /PRN="\\Colt-EPAPP01\Zebra GX420d - ZPL (Garitta)" /DBTEXTHEADER=3 /R=3 /P
%END%0 -
Jon Farley
★ BarTender Hero ★
Hi Matthew,
Funny, I've been trying to do almost exactly the same thing you are with Epicor ERP & a table in the label. In my case I do not have a limit to the # of records, which is fine since they label should extend onto the 2nd page if there are more than what fits on one label. I cannot hard-code to a specific # though.
I'm getting the same exact error that you are, I did have to make a DB connection for the main template or it wouldn't render on the dropped file. What I did was make a text file db connection but then make it a 'named database' so both the table & template should see the same data and that works (in design). I do not even have a single field on the template itself, only the table, so giving it a db connection on the label is just to make it happy so that it will attempt to render.
But I got the same issue as you, it basically tries to show one full label for each record on the template data file, so if I have 5 rows in data file, I get 25 rows printing.
**The fix for this is to just at the db config on the template, set it to limit rows to 1 (db setup>options>Limit # rows to 1). This way it renders for 1 record, but the label prints for however many pages the data file needs.
I even have a group by, and have a group footer that does a page break at the end of a group value - one label per job, but multiple _part_ records per job.
This renders perfectly (in designer).The problem, as you're seeing too is that when dropping a data file to feed the integration, the table cannot see the data. If you look at the event log, it shows the data just fine though, shows the command line as well, but it is just not 'passing off' the data properly to the table when run via the integration. I have a case open with support but it's still pending.
Hopefully this helps, but let me know if you get the main issue resolved too.
0 -
Matthew Garitta
★ BarTender Hero ★
Yeah...I just found this post from Peter Thane yesterday. It seems to work perfectly. I also realised I may need to use more than one label...this took care of that as well.
0 -
Jon Farley
★ BarTender Hero ★
Thanks much Matthew, I hadn't seen that one yet either & thanks very much Peter for your input on both cases! The template method may work for us, but I'll be doing some testing.
We do have the label with the table working beautifully though, I'd really like to see this table functionality work, otherwise we'll be doing some workarounds to make the page template approach do what we need. Group header/footer features are nice.
Did you have to change your data file at all, in order to use the page template? Are you able to still 'group by' your parent field, if you have 2 labels, so that it only shows the overflow for the 1st page, on page 2, then it kicks over to a page 3 for the next/new parent value? Do we have the ability to do a break or 'start new label when this field changes' with a pg template? I only see the 'Break when field changes' option in the 'Records per item' approach (in db setup)?
0
Please sign in to leave a comment.
Comments
5 comments