Bartender help

So I am working on converting and excel process we use for printing out print for the shop to bartender. I have a BAQ that groups and sums up each part number on a job so that they get one print with a total qty for the job.

Here’s the example. The front of the print, I have working just fine.

The back of the print (we print double sided) is going to have a barcode for each job and operation so that they can clock into the applicable operations with a single barcode.
image

Here is the data, I’ve use the comma delimited to add the multiple values into a single cell.

I need to be able to pull these operations out of that single column into bartender. The order will matter (it has to be in that order) and I would like it to be dynamic so I don’t have to hardcode values into the templates.

I can make a new query where I duplicate rows if I have to to be able to send to bartender utilizing page breaks, but I was going to see if I could use the same data for my template in bartender in order to have a single source so I have redundant systems without have to maintain redundant BAQ’s (or chop it up in the code I’ll use to write out the CSV)

In Bartender, I can make multiple templates that show up on conditions, but I would have to make them hardcoded (I think) and then the order wouldn’t be preserved since it would be basically if field contains x.

Does anyone have any elegant solutions for this? At this point the only options I see are making a new BAQ that duplicates the rows, or duplicating the rows on export from the customization that I will build in the C#.

Are there only a maximum of 2 operations?
If so, use a function to split the data and display the first half in one barcode and the second in another. If you have more operations available, then perform more splits.

no, could be more.

How does the split work? I was trying to figure that out, but I couldn’t get it to do it. That needs to be in a VBScript in bartender right?

That sounds likely. I don’t believe there is a built in function like Split(myField)(0) without VB.

I did something like this

Function SetPartText(PNum, ActualPartNumber, PartTotalQty, PartBoxes, PartBoxQty, PartWeight, PartWeightUOM)
	Dim PartNumber, QtyText, btNamedSubString

	btNamedSubString = ""

	'Aalstec has some typos but in order not to break all the connections
	'let us just change the outcome here
	QtyText = "QTY"
	if PNum > 2 Then
		QtyText = "Qty"
	End If

	PartNumber = CStr(PNum)

	'Set All Values
	btNamedSubString = btNamedSubString & "Part No " & PartNumber & vbLf & ActualPartNumber & vbLf
	btNamedSubString = btNamedSubString & QtyText & " " & PartNumber & vbLf & PartTotalQty & vbLf
	btNamedSubString = btNamedSubString & "Packs " & PartNumber & vbLf & PartBoxes & vbLf
	btNamedSubString = btNamedSubString & "Pack QTY " & PartNumber & vbLf & PartBoxQty & vbLf
	btNamedSubString = btNamedSubString & "PartNumber_Title_" & PartNumber & vbLf & "PART NUMBER" & vbLf
	btNamedSubString = btNamedSubString & "TotalQty_Title_" & PartNumber & vbLf & "TOTAL QTY" & vbLf
	btNamedSubString = btNamedSubString & "Packs_Title_" & PartNumber & vbLf & "# PACKS" & vbLf
	btNamedSubString = btNamedSubString & "PackQty_Title_" & PartNumber & vbLf & "QTY PER PACK" & vbLf
	btNamedSubString = btNamedSubString & "AtSymbol_" & PartNumber & vbLf & "@" & vbLf

	SetPartText = btNamedSubString
End Function


Function EvaluateAllParts()
	Dim partString, part, ActualPartNumber, PartTotalQty, PartBoxes, PartBoxQty, PartWeight, PartWeightUOM

	Dim btNamedSubString
	btNamedSubString = ""

	For i = 1 To 8

		partString = Format.NamedSubStrings("CHARACTER0" & CStr(i)).Value

		If partString <> "" and InStr(partString,"|") Then
			part = Split(partString, "|")

			ActualPartNumber = CStr(part(0))
			PartTotalQty = CStr(part(1))
			PartBoxes = CStr(part(2))
			PartBoxQty = CStr(part(3))
			PartWeight = CStr(part(4))
			PartWeightUOM = CStr(part(5))
			btNamedSubString = btNamedSubString & SetPartText(i, ActualPartNumber, PartTotalQty, PartBoxes, PartBoxQty, PartWeight, PartWeightUOM)
		End If

	Next

	Format.NamedSubStrings.SetAll btNamedSubString, vbLf

End Function

1 Like

So you basically made new columns out of the data coming in. Right?

Another random question, does anyone know how to make the page template sit behind the other templates? right now my print is covering up my stamps.

Has any of you guys seen this problem? I’m bringing in image files by a file name from the database connection, and now some of my picture files are rotated.

Brandon,

This is changing gears on you, but have you considered using code in a BPM to kick off the data? With C# code and LINQ statements to your data, you can basically make the CSV file look however you want to do it. Basically, move all of your heavy lifting to the custom code, then your Bartender becomes a pretty simple template.

Kevin Simon

I’ll be getting all of the data from a BAQ. I was going to have rows on the front page but since I couldn’t do that, I have everything on the front page duplicated on each row between page breaks (with tilde delimited fields so I can add carriage breaks) , and everything that goes on the back on the individual rows. The last problem I have to figure out is this rotating issue. Once that’s done, I’ll make a button on a dashboard the calls the BAQ, builds the CSV and drops it into the watch folder. I’ve done that already quite a bit.