Combining Data From A Csv And Printing (Just) The Master Data 追蹤


First the Caveat - This is my first attempt at writing VBScript for Bartender...


I am importing data from a CSV file that is basically "Container Label Data"; amongst other information it will contain a "Part Number" and a "Quantity". My goal is to collect that "Container Data" by summing the "Quantities" for each (distinct) "Part Number", then printing out a "Master Label" for each distinct "Part Number". My example...

Suppose I have the following container Data

Part#    Qty

A100      50

B100    150

B301      25

A100      50


After "collecting the data" I would want to print out the following "Master Records"

A100    100   <=== Note this is the sum of all Quantities for Part A100

B100    150

B301      25


I have VBScript (that I developed in Excel) to deal with "collecting" the data (and I know its not going to be just a Cut/Paste into Bartender)... But what I am struggling with is how to "export" the Scripted/Summed data to the template... I've done a bunch of searching with no hints that lead me to a solution...


My thought is that I would use an Event Driven script...

Collecting the data through the OnNewRecord event...

then use the OnPrintJobEnd event to export the data I have "summarized" to the Template... But I haven't been able to find an example of "Print this row through this template"...


thanx for any help!

1 意見

Ian Cummings
評論操作 永久連結

Are you connecting BarTender to this Excel file to print a label for each record that you query?  If yes then I suppose you could setup a data source to log a running total for each product printed using an event based VB script, and then have an end of print job template print the "master label" sourcing the summed totals for each part as you previously recorded.