Script To Skip The Record If And Print The Next One
I have an excel file with lots and lots of rows(record), in this case: boxes.
The boxes of course contain styles, some boxes contain only one. For this case, Excel has one row
with carton number and the style in it. For some other carton with multiple styles, there are several rows with
the same carton number. One row per style, repeating the carton number.
Issue 1:
As default, all records in the Excel sheet need to be printed (if the all the cartons contain only one style) but during printing:
how can I make Bartender skip the current record if the carton number is the same as the previous record.
Issue 2:
within the label, I need to list the content of the box up to three items (styles). Knowing from ISSUE 1 that I will only print 1 label when
multiple similar box numbers exist, how do I make Bartender to list in the first record of a new box all styles packed in that box?
BOX#|Style|QTY
1|BB123|3
2|BB123|5
3|CC654|5
4|CC655|3
4|CC656|4
4|CC657|3
5|VV456|2
5|VV457|1
6|FF741|2
7|BF347|3
Only 7 labels to be printed and each label will contain the styles packed and QTY of each
THANK YOU so much for your help!!!!!!
The boxes of course contain styles, some boxes contain only one. For this case, Excel has one row
with carton number and the style in it. For some other carton with multiple styles, there are several rows with
the same carton number. One row per style, repeating the carton number.
Issue 1:
As default, all records in the Excel sheet need to be printed (if the all the cartons contain only one style) but during printing:
how can I make Bartender skip the current record if the carton number is the same as the previous record.
Issue 2:
within the label, I need to list the content of the box up to three items (styles). Knowing from ISSUE 1 that I will only print 1 label when
multiple similar box numbers exist, how do I make Bartender to list in the first record of a new box all styles packed in that box?
BOX#|Style|QTY
1|BB123|3
2|BB123|5
3|CC654|5
4|CC655|3
4|CC656|4
4|CC657|3
5|VV456|2
5|VV457|1
6|FF741|2
7|BF347|3
Only 7 labels to be printed and each label will contain the styles packed and QTY of each
THANK YOU so much for your help!!!!!!
0
-
Hello rits,
1. One option to avoid printing duplicated or repeated records would be to access the "File>Database Connection setup..." option and, under the "Options" tab, uncheck the "Allow Duplicates" option.
This will remove all records with repeated information over the [i]USED[/i] fields. If you only wish to apply this [i]selection[/i] over one of your fields (not considering the rest) you'll need to design a custom SQL statement under the "SQL" tab from the same dialog.
2. The previous option wouldn't really fulfil your needs and would make nearly impossible to achieve your second request. A better option available only if working with v10 would be using a Template selector combined with a VB Script.
Using the VB Script you'll need to save for each record the "Carton Number" and, also for each record, compare it with the previous one. If they are the same, the template for this new repeated record won't print (the value for the template selector is changed so it doesn't identify the correct template).
As this will allow the application to run through all the records you should also be able to use a VB Script to count the repeated ones and print the result, being that the case, you'll need to consider printing that precise template only for the last repeated record (you'll need to think on the VB SCript for that, also comparing the present value for "Carton Number" with the next record's one, for that you'll need to create a second connection to the database through the VB Script).
3. Thinking about this issue in general (especially your second request), I think it would be way more simpler to design an external application that does what you require and automates BarTender to print the required documents with the require data.0
Please sign in to leave a comment.
Comments
1 comment