|
|  |
 |
 |
Define a Starting Position for Labels
TP063
by Stan Mathews
Here's a very clever (and simple) way to define which label to start on when you have a sheet of labels that isn't full.
If you print labels, you know how frustrating it can be to end up with a partial sheet. You don't really want to start more labels on a new sheet, but how can you tell your program where the first label is on the partial sheet? Here's the answer:
| 1. |
Add a 'blank' record to the table on which the label is based. This record will be "printed" at each label position to be skipped. Therefore, the fields to be printed should be blank to avoid printing, and possibly smearing, on the glossy label backing where the previously used labels were removed. If these fields can't be left blank, a color equation should be defined to "white out" the text for this record only.
Example: IF( isblank( "checkfield" ), "White on white", "Black on White" )
|
| 2. |
Have the user input a starting position value to a variable that defines the position of the first available label on the sheet. (It would be a good idea to add a routine which verifies that the user did not enter a value less than 1 or greater than the number of labels on the sheet.)
|
| 3. |
Make sure the filter or other record selection criteria will include the blank record as well as the “real” records to be printed.
Example: filter = "isblank( 'checkfield' ) .or. between( due_date, var->dt1, var->dt2 )"
|
| 4. |
In the "quantity to be printed" box under label Properties, you can enter an expression rather than a simple quantity. Set the quantity for the blank record to be the position variable minus 1. (If the first "real" label is at position 5, you want to print 4 blank records first.)
Example: IF( isblank( "checkfield" ), variable-1, x )
where checkfield is the field name on which you sort the records, variable is the starting position variable value, and x is the number of labels to print for all the valid records (usually this number is 1).
|
| 5. |
In the order expression for the label layout make sure the record with the blank field prints first. An easy way to do this is to sort ascending on a field where the “real” records contain values.
|
With these specifications in place, the label for the blank record will always print, it will be printed first (sometimes the quantity will be zero (1-1) so it won't affect the output), and the next label (the real label you want to print in the first available position) will appear where it should.
NOTE: If you use Text objects on your labels, these objects do not allow color equations so they cannot be blanked out. To solve this problem, change them to calculated fields. Then substitute the calculated field(s) in place of the plain text object and set the color equation for the calculated field.
Example:
Calc Field -
MyCalcField = “My Text”
Color Equation -
IF(isblank("checkfield"),"White on White","Black on White")
[PRINTER FRIENDLY VERSION]
|
|
|