Fill out multiple line rich text field by using a symbol.
Hi all,
our company sells fertilizers in different sizes of packaging for the same product.
The label text is in our database, and it is a rich text field. According to the new regulation I need to make the declaration as follows:
Specification:
Total nitrogen ________________ 1%
Total potassium_______________1%
Between the parameter and the value the space needs to be filled in by a certain symbol (in this case _). Due to the different sizes the width of the label space is different, and a different amount of symbols is needed.
The rich text field contains multiple lines of text. I do not want to use multiple fields in my database as this is verry product specific and varies alot.
I would like to have the following:
In my database I type:
Specification:
total nitrogen ##_##1%
total potassium ##_##1%
I want the script to do the following:
Look for ##_## in the database field and replace by X times _. X is determined by the width of the text field (in bartender) minus the lenght of the other text present on this line. This way we have parameter left, and value right filled in with a number of _.
This script should function with every size as it determins the width of the bartender rich text field and adjusts accordingly.
Can someone suggest how to make this happen? Or suggest an alternative.
-
Peter Thane
★ BarTender Hero ★
If the values form part of the same the field in the database then you would need some VB to split them, but if not you could achieve this without using VB.
For this add the database field on to the label (probably off to the side so it will not print) but either give it a Name or else make a note of the Object Name (which is Text 2 in the image above).
For the actual label field, this needs to be made up of two sub strings, both which are configured as Object Value field and then linked to the field above.
For the first sub string, via the Transforms tab set the Character Filter to Alpha Only. The Character filter for the 2nd string should be set to custom with a string range of 1234567890_.%
Also configure the Number of Characters to however many characters minimum this needs to be with a left padding of _ but disable the warning and hopefully that should be it.
0
Please sign in to leave a comment.
Comments
1 comment