Conditional Formatting Object Position based upon size of adjacent object Follow
I have seen other requests on this topic here, but have not found a solution.
(see Setting X Position Of Object B Based On X + Width Of Object A) Sounds like a similar situation, but I did not see that it was resolved.
I have object 1 that is read from a database and could be variable in length (its a percentage).
Object 1 is in a different size font and only a single line.
Object 2 (Title) adjacent to the right is variable length and read from a database and of a different font and font size and may be on multiple lines depending upon length.
Both objects are pararaphs so that the width can be variable with the content.
I want object 2 to change positions according to the size of object 1 and also to change the width so that the combined width of objects 1 + 2 is consistent.
I have applied a VbScript On New Record that partially works; that is, it does change the position of object 2 based upon the width of object 1, BUT it applies it to the next label or record printed; not the current one being printed.
Example: if the first record object 1 value is "1%", there will be too much gap between the two objects. Then if the next record is "10%", the position of object 2 will be moved to the left where the end of "1%" would have been and they print over each other. If the following record is also a single digit, then it works great! But, that is not usually the case.
Similarly, if record object 1 value is "100%", it will re-position object 2 further to the right, but on the following record; not on the record with a value of "100%".
It seems to be a timing of application when it reads the width value and applies.?
The script is as follows:
Format.Objects("Identity w/ %").Width = 1.25 - Format.Objects("Percent").Width
Format.Objects("Identity w/ %").X = Format.Objects("Percent").X + Format.Objects("Percent").Width
Thanks for any assistance;
★ BarTender Hero ★
Please sign in to leave a comment.