BARTENDER 2019 Get number of copies in VB script

Hello,

Anyone know how to get the number of copies that were printed inside the VB script on a bartender label??

Thanks,

Utah

Where is the data coming from? I have been setting up an integration to accept print commands from Epicor in the text file recently. Is this some data you could include in the input file? Or is there a piece I’m missing with the VB Script part?

What’s up Chance.

We are sending the number of copies as an argument. Forewarning I don’t know much about bartender and this was built by practical as I understand it. It is working great, I just would love to get the number of copies to be able to decrement from that each page.

we are calling it as a command like VM\Labels\Testing\TESTING.btw/C=3/P/X";

Process.Start(sBartenderPath (where the .exe is on the client),sReportPath (the report path and the copies variable));

See the C=3 argument in the report path variable. That is the value I would like to get.

In the bartender report there are page numbers and I total number of pages. So if you are running each command separate, this will give you the number of copies printed.

So here we go man.

I am trying to decrement the TotalNumberOfPages.

I have tried to do this using the variable you pointed out, but have been unsuccessful.

Have you ever done this?

Here is the use case. We would like to print labels that have 1- X on them and then put label 1 on the 1st roll of product that comes off the machine, the second label on the second roll and so on and so forth. They need to come off the printer with the highest number first so that the operator can spool them (roll them up) resulting in the 1st label being the one that is ready to peel first. Right now they print 150 labels and then they have to wait for the whole job to finish till they can start rolling from the last label to come off the printer. If we can figure out how to decrement and have the highest number print first they can start rolling them as they are being printed.

In short, would love to decrement a the total number of items printed or total pages variable in bartender. Can’t seem to get it to work given the way we are printing it (as posted previously).

If I print from the bartender suite I can get it to work, but I can’t get it to decrement printing it as we are from the command.

Try this.

You can make named data sources.

So do one for the total pages, and one for the page number.

Then use a VB script and subtract one from the other.

I never wired it all up with a source and whatnot, but it seems promising.

I did that the other day and it works all cool until you try and decrement it…

I got that to print out. It will print on every page, but the second I try and decrement it, it just prints 9999, 9998, 9997 etc.

So the decrementing part is working, just not the total pages then right?

The total pages or items is working until I try and decrement that field.

Hey buddy,

Assuming you can reference the fields in the label with the VB script, my suggestion was going to be to append the number of copies to a field in the csv portion of the .bt file. If you have a seed csv file to populate the label just include it there and call it number of copies or something.

Add a field to the end of the csv file used to create the label that contains all of the field names and sample values
image

Right Click Database Fields
image

Browse for the file name of the csv used to create the doc

Bingo Bango Bongo your field has been added
image

As for help with decrementing the value in the VB script and as to why you need that, i’m not your guy. Never touched the vb script portion.

2 Likes

I don’t have a csv I am pulling unfortunately. Thanks for taking the time to put those images together with the instructions.

1 Like

If your label has Database Fields filled out, you should be able to recreate the csv manually. The data in the csv doesn’t affect the actual printing of the report. The file name in the connection properties is just to design the report as far as I am aware.

Assuming you appended the number of copies into the data they were constructing in the BPM it would come through when printing the label. Not sure how its configured but its likely in a custom code widget in a BPM