Skip to main content

Search

Search

Variable Database Field Length

Comments

3 comments

  • Avatar
    Fernando Ramos Miracle

    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
  • Avatar
    Legacy Poster

    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
  • Avatar
    Fernando Ramos Miracle

    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.