Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Printing multiples of labels on a sheet


This topic is 7352 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi -

I am using FM with a barcode creation plug-in to create inventory labels - labels with a product's name, SKU and barcode. Unlike address labels, where I would want one of each record, I have multiples of each label that need printing (and not necessarily the same number for each record.) The labels are printing on full sheets rather than spool-fed individuals, so if I simply specify a number of copies of a single record to print - let's say 15 - I'll be wasting a half of a sheet of labels each time.

I would appreciate it if anyone has any ideas for how to deal with this - for instance a script that uses the number in my inventory field to specify how may of each record to print.

Thanks in advance.

Posted

I once came across a solution for this problem. The solution involves using a secondary temporary database and using repeating fields to create multiple records in the secondary database. There is a neat trick when importing records with a repeating field into a database that doesn't have a repeating field. When you import, it asks you if you would like to split up the record into multiple ones, each with one value of the repeating field. (The option is to simply loose all the data in the repetitions.) For example, if you have repeating field with 5 values, you would then have 5 records in your new database.

So, in your main database you need a repeating field with as many repetitions as you would ever want to print labels. Then, a script populates those reptitions with some piece of data (an "x" works) for as many repetitions as you want labels in that particular case. Then, you call a script in the temporary database which runs the import of the records, prints the labels, and then deletes all the records before closing. (That is an important last step, since otherwise those records will create more labels than you want the next time your run it.)

I know I am not explaining myself particularly well, but if you would like me to send you some sample files that demonstrate what I'm talking about, let me know. There are in FMP 5.

  • Newbies
Posted

Hi Sheryl -

That sounds like it would work. You did a pretty good job of explaining it, I'm just a little foggy about the part where I use X to populate the repeating field, and also about how to use the contents of a field (I have a field for current number in stock already that would be ideal to use) to specify the number of repetitions. If you would be willing to send me the example files, I would really appreciate it.

Thanks for taking the time to respond,

Lauren

[email protected]

Posted

Sounds a little ugly with repeating fields. I would favor a looping script to create records in this secondary file (or table). A field in the first file would specify how many of each label/product/record to create. Records in the second file need only have a foreign key field to match, say, the record ID in the first file. All other fields can be displayed using a relationship based upon this match of foreign key to record ID. The looping script could be in either file. You would loop through the found set of records in the first file and run a looping script to create the specified number of records in the second file. Printing would be from a label layout in the second file.

-bd

  • Newbies
Posted

That actually sounds a little more elegant, but I'm still not sure how to use the number found in a field to specify the number of times to loop. Do you know of somewhere I could view a similar script to use as a model?

Thanks for the help.

Lauren

Posted

I'm trying to do something similar, but I'm still not clear on why I have to create another databse and write a script to print 50 of the same labels. I'm not good with scripting and I'm simply trying to print out cassette tape labels.

Does anyone have an example?

Posted

I am working on a similar problem, needing to print X number of signs on a laser engraver from a database of plant names, where X is a field value.

I have thought of the following approaches to a solution, I'll probably be trying the third:

1. The repeating fields solution. In addition to the above described approach, you need a subscript step that deletes records where the multiple-value field is blank in the temporary database. When you "split multiple values" into seperate records, it makes a copy for each repetition, regardless if there is a value in the repeating field or not. So say you marked 5 of 7 repeating fields in a record for 5 labels. If you import that record into the temporary database with the split option, you will wind up with seven records, not 5: 5 will be marked in the split-repeating field value, 2 will not. You need to delete or omit those 2 that are not marked before printing.

2. A looping import script. The basic premise is, in the master database, you will need a global count field (type = number) that will keep track of the number of times a record has been imported into the temporary database. Begin by setting the global count to 0 and making sure there are no records in the temporary database. Call a subscript in the temporary database to import all the found records in the master database (assume that they all have at least one label requested). Increment the global count by one (1 copy of the records imported). Then either re-find the records, finding only those where the quantity > global count, or loop through the found records and omit those that have quantity <= global count (where qty <=1). This will leave you with records that need 2 or more labels. Call the import script again in the temporary database. This maks two records in the temporary database. Increment the global count by one (now stands at 2), Again loop through the records, omitting those that have quantity <= global (<=2). etc.

Remember to sort your records before you print, or they will not be printed next to each other. I've gotten a script to do this, but it is a little messy and I'm afraid will be too complicated for the casual user to use. (if it gets aborted, or something strange happens between the files)

3. A third approach is to export/import all the records that need printing to a temporary database. Then loop through those records in the temporary file and duplicate those records who's quantity requested is less than a global count field. Increment the global count field between duplications. I think this one might be the least trouble to maintain and fewer back/forth steps between database files.

In the master database script, find the records that need to be printed.

Call a subscript from the temporary database to import all of these to the temporary database.

Loop throught each record.

__In a global count field, set the value to 1.

__Loop

____If qty needed = global count, exit loop

____else {Duplicate the record}

__End loop

__Next Record

End Loop

Sort Records

Print

Delete all records in temporary database

If I come up with a viable template to demonstrate any of these, I'll post it.

After a week like this at my work, I'm suppriosed I can rub two thoughts together in my head!!! hairout.gif

Chris Echols: A seperate database table is only needed when you need to print various numbers of labels per record based on a field number at one time. If you want to print 50 of the same kind at once, you can design a layout that has several copies of the field you want to print displayed in different positions on the label sheet at the same time.

<<title>> <<title>> <<title>>

<<date>> <<date>> <<date>>

Posted

Here is a copy of a working solution for this in FM 6, using method: export records once, duplicate records X number of times. If you can't use the .zip format (7kb), contact me directly for email copies (40K).

There are two files, [color:"green"]Master, and [color:"green"]Temporary multiples. In the [color:"green"]Master file, you will find three records, each with slightly different data ( Product, SKU, UPC Barcode ) and different number of labels needed under quantity. The first script in this file, Make multiples in Temporary file will do the job.

It runs an external script from the [color:"green"]Temporary multiples table, imorting the found set of records from [color:"green"]Master. Then it updates a field in the [color:"green"]Master file saying when the record was exported, and finally calls the second script in [color:"green"]Temporary multiples that loops and duplicates the records the same number as in quantity for each of the master records.

Hope this helps, I will try implementing it in my solution when I can schedule some down time for the server.

print_multiples.zip

This topic is 7352 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.