Zum Hauptinhalt gehen

Suche

Suche

Change Position And Font Size If A Data Field Is Empty

Kommentare

7 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    Yes this is possible with recent versions of BarTender.  I suggest you take a look at the below white paper:

     

    http://www.bartenderbarcodesoftware.com/label-software/whitepapers/dynamically-changing-objects-at-print-time-using-vb-script.pdf

     

    And check the BarTender Help system under the "Visual Basic Scripting>Scripting Objects>Object Reference>Object Object" topic for a full reference on what's available.

    0
  • Avatar
    Legacy Poster

    Thanks but unfortunately I cant figure this out attached is me btw file and my data file from the c:/ folder what I am looking that if line 2 is empty then line 1 Position Y = 0.8 font size = 14pt.

    So when the 3rd line from the database is getting printed it should move "Field: db.line 1" to Position Y 0.8 and change font size to 14pt

    Can you please do it on the attached file and upload it for me 

    Thank you

    0
  • Avatar
    Legacy Poster

    Thanks but unfortunately I cant figure this out attached is me btw file and my data file from the c:/ folder what I am looking that if line 2 is empty then line 1 Position Y = 0.8 font size = 14pt.

    So when the 3rd line from the database is getting printed it should move "Field: db.line 1" to Position Y 0.8 and change font size to 14pt

    Can you please do it on the attached file and upload it for me 

    Thank you

     

    Any help?

    0
  • Avatar
    Ian Cummings
    Moderator

    From the "File>BarTender Document Options" menu item select the "VB Scripting" tab and create a VB script for the "OnNewRecord" event.  You would then enter in something like the below:

     

    If Format.Objects("Text 2").Name = "" Then
    	Format.Objects("Text 1").Y = 0.8
    	Format.Objects("Text 1").FontSize = 14
    Else
    	Format.Objects("Text 1").Y = 17.5
    	Format.Objects("Text 1").FontSize = 12
    End If
    
    0
  • Avatar
    Legacy Poster

    It moves it to Y 17.5 even if  Objects("Text 2") is empty

    0
  • Avatar
    Legacy Poster

    It moves it to Y 17.5 even if  Objects("Text 2") is empty

    Please help

    Thanks

    0
  • Avatar
    Ian Cummings
    Moderator

    Ooops, looks like I made a typo.  See the correct code below:

     

    If Format.Objects("Text 2").Value = "" Then
    	Format.Objects("Text 1").Y = 0.8
    	Format.Objects("Text 1").FontSize = 14
    Else
    	Format.Objects("Text 1").Y = 17.5
    	Format.Objects("Text 1").FontSize = 12
    End If
    
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.