Variable Database Field Length
Today we downloaded the trial of Bartender and connected to our Sql Database. In designing a template, we have a database field that could contain e.g. 10 characters or 300 characters.
I could create an object which allows 300 characters, but we then have large spaces between objects where the content is 10 char.
We could use the auto size, but we require that the font size remains constant on the label.
Is there anyway we can size the object depending on the number of chars?
-
Hello Herenow,
How exactly would you like to automatically size the object? Seeing that the difference in data size is so big,wouldn't you need to also adapt the rest of your label objects?
1. One thing you could do is use different Templates (from the "File>Page Setup..." dialog under the "Template" tab), on each template adapt your objects and text to ta different size of data, and at print time select one (using the template selector) depending on the fields length.
2. As a second options you could use the same idea but using different layers (conditionally print the layer depending on the field's length) instead of templates.
Regards.
0 -
Just saw this post from last year, and have a similar problem (we are using Bartender with automation from an external package).
We can create fields (linked to a SQL database), and not sure how to position the fields on the label. As they are variable lengths, we either have overlapping, or lots of white space!
I did wonder if we could put the same field on in different places, and then use a VB script to find the length of the previous field and then show the most relevant one. Not 100% accurate, but better than what we have.. Only issue is -- not sure where to begin! I could ask in the VB forum, but don't want to double post.
0 -
Hello Markc,
To verify the length of your database field through VB Script you can use the below property:
Len(Field("databaseFieldName"))
The idea would be to have a "Named Data Source" of the type VB Script that takes a certain value depending on the length of the database field. Then use the "Template Selector" to print a different template depending on the value of that named data source.
- You can access the "Template" feature from the "File>Page Setup..." dialog under the "Templates" tab. You'll need to create a separate template for each of the "appropriate data lengths".
- You can create a new named data source if you right click on the "Named Data Sources" item of the "Data Sources" toolbox. If you don't see this toolbox activate the "View>Toolbox>Data Sources" option.
If you need further help please let me know.
Regards.
0
Please sign in to leave a comment.
Comments
3 comments