Zum Hauptinhalt gehen

Suche

Suche

Conditional Formatting

Kommentare

6 Kommentare

  • Avatar
    Ian Cummings
    Moderator

    The quick answer is yes.  See the following white paper: http://www.seagullscientific.com/label-software/whitepapers/dynamically-changing-objects-at-print-time-using-vb-script.pdf

     

    Object properties to adjust would be:

     

    Object.TextBackgroundColor = Color

     

    Object.TextColor = Color

     

    See the BarTender help system for a full reference of all properties available.

    0
  • Avatar
    Legacy Poster

    I tried this as a test but can't get it to work.

     

    Set Notice = Objects("Text_16")

    If (Field("case_description") = "NS") then

    Notice.TextColor = btColor.RedColor.

    Else Notice.TextColor.Green

    end if

    0
  • Avatar
    Legacy Poster

    I read the documentation. It doesn't work. Not a big surprise.

    0
  • Avatar
    Legacy Poster

    What's with the tone...? I got this to work in like 2 minutes just now, so...

    1. Make the database connection
    2. Create a dummy BarTender text object to hold the database value
    3. Assign a name to the data source of that object/substring
    4. Go to File > BarTender Document Options > VB Scripting
    5. Check "Use VB Scripting", add something like the below code to the "OnNewRecord" event
    If Format.NamedSubStrings("bg_val").Value = "NS" Then
    	Format.Objects("test").TextBackgroundColor = Black
    	Format.Objects("test").TextColor = Red
    Else
    	Format.Objects("test").TextBackgroundColor = Green
    	Format.Objects("test").TextColor = Black
    End If
    

    ..whereas "bg_val" is the name of the data source that holds the database value and "test" is the name of the (BarTender) object you want to manipulate.

    0
  • Avatar
    Shotaro Ito

    When you use Seagull driver, make sure print box as [Raster Graphics],

    From Print dialog > Object Print Method > Box.

    Also do not use device font (Printer font), use Truetype / Opentype font.

    0
  • Avatar
    Legacy Poster

    I finally got it to work. I was overlooking the named data source. Thanks for the info.

    0

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