BarTender Gremlins

Our label printers are installed on the print server and not installed on the bartender server.

We have Printers on the Print Server and at 1 Location we have them on the BT Server, seems to be the same as long as they are shared and have a UNC Path, as long as you use the BT Drivers you should be good :slight_smile:

I even have one pointing to Port COM1 (no where) I use for development, I can Print to COM1 and it shows up in Print History and BarTender Re-Print Station. While it uses BT Drivers. If anyone needs a development Printer, add one with the Zebra Drivers from BT and Port COM1 :slight_smile: or some custom FILE Raw Port. Make it Shared and thats all you need the UNC Path, then add it in Epicor as a Development/Testing Printer Device.

I wish my upgrade to BT 2019 was so easy and care free!

It wiped the permissions from the Bartender System DB - locking all users out! I had to work out how to get around it, and then setup the permissions again. Looking at the release notes for BT 2019 R2, it reports a fix on “blank permissions” or similar - I think I ran head long into that issue!

I also found some error pops were being experienced in Print Station after the upgrade - they’ve added a new feature to each field on a label - called Error Handling. It was producing an error because a field was blank on the label (not populated on purpose in this case - some products will have data in the field, most won’t). Had to visit a few label .btw files and make the changes to that setting to ignore.

Also, when installing BT 2019 over the top of BT 2016 it wipes out the domain user/password on the service accounts which is very annoying! 3 services per PC or server that it’s installed on, and a complex password because it’s for a service - that was a fair number of repetitions typing those details back in!

2 Likes

Yikes! I am still on BT2016 and 9.4 to 2016 went good and 10.1 to 2016 went good. I think the only tweak I did have to do like you is our BarTender_Reader Service Account we used on ODBC Drivers needed to be added to have Permissions.

I figured 2019 would be more like 2016 with additions, thanks for the info and heads-up!

Forgot to put on the end of my last post about permissions.

I sometimes add a new printer to my print server (PRINT01). I then design a label, and setup a new Integration within BT. Testing it, I observe the same as you do - BT picks up the file, deals with it and looks like it has printed. BUT, it hasn’t.

As I’m using a domain account on the services where BT is installed (EPICORMISC01), I need to login to that server and make a connection to the print device on PRINT01. It has to be done as that particular service account user, then it will work just fine. That doesn’t explain your sometimes works/sometimes doesn’t though!

Yeah test 2019 a bit more - I never had issues with earlier upgrades to 10 and to 2016 - same experience as you! My faith in BT was dented slightly recently!!

3 Likes

I think I had that with Commander when using a Print Server and I figured I just install the Printer on the same server as Commander and I think that solved it, but I brushed it off as a timing issue. Good Info.

But just like you we run the Commander/Integrations Service as a AD Service Account which is in a Epicor_Admins Group and that Group has access cross-epicor Servers. Since our .bt files are on a diff server than the .btw templates.

Thanks for the info, I must admit Integrations is alot faster and stable than Commander. Especially in a high-volume environment. Definitely will do more testing on 2019.

@markdamen remember going from E9 to E10 and they added a _ prefix to all field names :slight_smile: lol I had to modify about 78 templates. Some of them even had VBScript Events.

Such as:
2019-05-29_1254
image

I’ll have to ping you a separate message or create a new post regards vb script in BT.

I currently use BT script to pull a list of PartNum’s from Epicor into a drop down list - I then want to use whatever PartNum the user has selected, and pull a few fields from Part_UD for displaying on the label. Fields such as LabelDesc_c, LabelWeight_c etc.

BarTender support tell me that I should be using the built in DB connectors, but I can’t seem to have it work such that it shows a list of PartNum’s (inc some filtering on PartType etc), and then take whichever one the user chose on the Prompt screen and pull fields.

1 Like

Yes in a Nutshell if you have a SQL Connector configured on the Server or on the Users PC then yes it can.

Example when you use Print Station I also write to the UD Serial Numbers table to remain in Sync.

You just have to add this into the OnPrintStart Event:
Note: you can omit the Login Credentials if you have SQL Connector in ODBC Settings via Control Panel Configured.

Set objConn = CreateObject("ADODB.Connection")
'objConn.Open "DRIVER={Progress OpenEdge 10.2A Driver};HOST=DELL-T710;PORT=9450;DB=mfgsys;UID=sysprogress;PWD=sysprogress;DIL=READ COMMITTED"

objConn.Open "Driver={SQL Server};Server=THINKSERVER;database=E10_Code;uid=sa;pwd=whatever"

Then inside the Functions Shared Event I put methods in like this:

'================================================
' Function to Generate a Serial Number based on
' a algorithm
'================================================
Function GenerateSerialNumber(BTValue)
	'Initialize Variables
	Dim min, max, serialNum

	'Set Min and Max
	min = 1
	max = 9

	'Initialize Random Number Generator
	Randomize

	'Return Serial Number
	serialNum = (Month(Date) & (Day(Date)) & (Int(Timer) ))

	GenerateSerialNumber = Int(serialNum) & BTValue
End Function


'================================================
' Function to Ask the Database what is the next
' usable Serial Number we should use
'================================================
Function GetNextUsableSerialNumber(objRecordset, BTValue)
	Dim suggestedSerial

	objRecordset.Open "SELECT TOP 1 * FROM Ice.UD07 WHERE Number09 = 200 AND (Date01 BETWEEN '" & Date()-350 & "' AND '" & Date() & "') ORDER BY Number20 DESC", objConn, adOpenStatic, adLockOptimistic, adCmdText


	If  objRecordset.RecordCount > 0 Then
		objRecordSet.MoveLast
		suggestedSerial = Int( objRecordSet.Fields.Item("Key3") )
		objLog.WriteLine "Records Found: " & objRecordset.RecordCount
	Else
 		suggestedSerial = 100000000
	End If


	objRecordset.Close

	'BTValue is no longer used but reserved
	GetNextUsableSerialNumber = Int(suggestedSerial) + 1
End Function

'================================================
' Function to Check if a Serial Number is already
' being used anywhere.
'================================================
Function CheckSerial(objRecordsetSerialCheck, serialNum)
	Dim returnValue 

	objRecordsetSerialCheck.Open "SELECT * FROM Ice.UD07 WHERE Key3 = '" & serialNum & "'", objConn, adOpenStatic, adLockOptimistic, adCmdText
	objRecordsetSerialCheck.Find "Company = 'DIEN'"

	If  objRecordsetSerialCheck.RecordCount > 0 Then
		returnValue = Int(objRecordsetSerialCheck.RecordCount)
	Else
 		returnValue = 0
	End If

	objRecordsetSerialCheck.Close

	CheckSerial = Int(returnValue)
End Function

'================================================
' Generate our Index Variable
'================================================
Dim currentIndex
currentIndex = 1

'================================================
' Define our Database Needed Variables 
'================================================
Dim objConn
Dim strConn
Dim objRecordset
Dim oField

'Define Database Connection parameter constants.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001

Of course you can then manipulate other objects etc…

1 Like

So on my Data Entry Form, I have a dropdown list that is populated using this code:

dataSource = "EPICORSQL01"
initialCatalog = "Epicor10Live" 
tableName = "dbo.Part" 
columnName = "PartNum"

'Create connection
Set objCon = CreateObject("ADODB.Connection")
objCon.ConnectionString = "Provider=SQLOLEDB;Data Source=" & dataSource & ";Initial Catalog=" & initialCatalog & ";Integrated Security=SSPI;Persist Security Info=False;"

objCon.Open

'generate SQL
strCon = "SELECT PartNum FROM dbo.Part WHERE AnalysisCode = 'F/P' and TypeCode = 'M' and LabelRequired_c = 1 and InActive = 0 and LabelFormat_c = 'REEL_BV' and PartNum not like '%O' and PartNum not like '%R' and PartNum not like '%C' and PartNum not like '%P' and PartNum not like '%M' ORDER BY PartNum"

'run query
Set rs = CreateObject("ADODB.Recordset")
Set rs = objCon.Execute(strCon)

'fill options
options=""
Do Until rs.EOF
	If Len(options)>0 Then options = options + vbCR
	options = options + rs(columnName).value
	rs.MoveNext
Loop

'Close connection
objCon.Close
Set objCon = Nothing

'set options
Value=options

That field is linked to a Named Data Source called EpiPartNum.

Then, each field on the label itself that requires data from Epicor has something like this:

dataSource = "EPICORSQL01"
initialCatalog = "Epicor10Live" 
tableName = "dbo.Part" 
columnName = "LabelDesc_c" 

Set objCon = CreateObject("ADODB.Connection")

objCon.ConnectionString = "Provider=SQLOLEDB;Data Source=" & dataSource & ";Initial Catalog=" & initialCatalog & ";Integrated Security=SSPI;Persist Security Info=False;"
objCon.Open

strCon = "SELECT " & columnName & " FROM " & Tablename & " WHERE PartNum = '" & Format.NamedSubStrings("EpiPartNum").Value & "'"

Set rs = CreateObject("ADODB.Recordset")
Set rs = objCon.Execute(strCon)

options=""
Do Until rs.EOF
	If Len(options)>0 Then options = options + vbCR
	options = options + rs(columnName).value
	rs.MoveNext
Loop

objCon.Close
Set objCon = Nothing

Value=options

It works like this, has been for a couple of years. The issues are that it doesn’t run super speedy - and if I try sending the .btw to Bartender support, they always claim it is corrupt. It isn’t, but because they don’t have the SQL server and DB name available I think it just sits for ages until it times out. One agent said that it did open after approx 1 hour, which is a massive timeout! Hence why they suggested using the built in tooling.

But, with the built in tooling it seems to misbehave. If I put a query filter on the SQL connection in BT, then it displays that prompt first before the data entry form - and the data entry form only has 1 part in it. The nice thing about the data entry form is that I have a preview of the label displayed as an image, and it responds to changes to Part Number, Use By Date, batch number and shows a live preview.

The only differences I think I have is

  1. I use the SQL Native Connector, not ODBC Connector (SQL OLE DB is old and deprecated) - Apparently there is a Native Connector if I recall since Win 2012
  2. I also tend to use TOP 1 which seems to run faster
  3. I open the Connection on PrintStart and Leave it open while only creating/closing RecordSets
SELECT TOP 1 * FROM....

I havent tried their new Multi-DataSource Tools yet.

But try to obtain SQL Native Client Connector I have v12 – But mine seemed to have come with Windows. You still configure it in the ODBC Settings via Control Panel, just a diff connector.

SQL Server Native Client is installed automatically when you install SQL Server or client tools and also avaialble by separate download.

I remember Progress was slow using OLEDB, where as SQL Native works great.

Lol did they revert it back again :smiley: loll in 2017
https://docs.microsoft.com/en-us/sql/relational-databases/native-client/sql-server-native-client?view=sql-server-2017

The SQL Server Native Client (SQLNCLI) remains deprecated and it is not recommended to use it for new development work. Instead, use the new Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL) which will be updated with the most recent server features.

So that isn’t an option in BT 2019, but I can select ODBC and then have MSOLEDBSQL setup as a datasource in Windows.

Still can’t get it to play nice with dropdown list though!

This is very likely the true fix.
Just got off the phone with tech support and there’s a bug that sometimes happens with Commander where switching printers would cause the drivers to crash. The workaround is to set the handler setup to restart the process after each command instead of every hour (which is default).
This is, of course, fixed in 2016+ since they ditched Commander for IB.

Found it! We had the same issue here.

1 Like