Zum Hauptinhalt gehen

Suche

Suche

Print Same Data Source With Different Transforms On Label

Kommentare

10 Kommentare

  • Avatar
    Fernando Ramos Miracle

    Hello LabelMonkey,

     

    Indeed this can be done; what you are probably doing at the moment is name your data source and use it on two different objects. Problem of this approach is that even though you work with to objects the data source is only one, so when you apply a transform action over it it will change on both objects (think of named data sources as separate entities that can be referenced from different label objects).

     

    What you could do instead is reference the "value" of the data source, instead of the data source itself. This can be easily done with a VB Script data source int he second objects (simply write "Format.NamedSubstring("<Name>")" as the script). Then you can apply any sort of Transforms option to this new data source.

     

    If the data is coming from a database instead of being fixed Embedded data, you don't even need to use a named data source, simply use two different Database field types data sources, both sourcing from the same field, and apply the truncation only to one of them.

     

    If you still have problems, please attach your BarTender document (.btw file) so I can take a look at it.

     

    Regards.

    0
  • Avatar
    Legacy Poster

    Hello Label Monkey
     
    I think what you are suggesting above is the solution to a problem I am trying to solve I have one scree data field that consists of two pieces of data.  I need to reference one or the other in various places on the label.

     

     

    I placed a screen data field on the label as a place holder for the value.  I will then format the characters to white so that it hides and we get the value.  I then use 'Format.NamedSubstring("<Name>) for each place I want to put either of those values contained in that one field and strip out the other.  However when I use this method I get -1 when trying to get the original value to manipulate.  I am using version 9.20.

     

    What should I be doing?

    0
  • Avatar
    Fernando Ramos Miracle

    Hello Jeremy,

     

    The text you need on the Visual Basic script is:

     

     

    Format.NamedSubStrings("ORDER_HDR_UDF_2").Value
     

    That will reference the named sub string with the name "ORDER_HDR_UDF_2". Also make sure you don't add extra quotes around the code.

     

    Regards.

    0
  • Avatar
    Legacy Poster

    I'm hoping to get some help with this topic as well. I'm not sure how to do a VB script (never written one). 

     

    What I'm trying to accomplish is to enter a date at a prompt before printing, and have the date show up in two different formats on different portions of the label. In 2 sections, I want it formatted as YYYY-MM-DD, and in another section (embedded in a barcode) I want it to be formatted as YYMMDD.

     

    Can you walk me through this please?

     

    My file is attached.

     

    Thanks,

    Ken

    0
  • Avatar
    Fernando Ramos Miracle

    Hello Coneeleven,

     

    Actually for what you are looking for you don't even need VB script (or if using VB script you would only need a very simple reference). Note that BarTender v10.0 and later includes what we call "data type" for each data source.

     

    In your case you only need to do the following:

     

    a. Relate the Data entry form with an object outside of your label. This object will contain the original "date format".

     

    b. Create your two date objects and change its data source type to "Object value". Make sure that both data sources are linked to the object containing the original date value. 

     

    c. Change the data type of each of these last two data sources to "Date" (under the "Data Type" tab when selecting the data source int he object's properties), scroll down through the formats until you reach "Customer" (unless you see a format exactly as you require it) and add the appropriate pattern for each of your date objects.

     

    d. The format would be yy-mm-dd for your first object, and yymmdd on the other one.

     

    *Note that the original text object receiving the date value from the data entry form is unchanged. The idea is that the other two date objects that are going to be printed are always able to source a correct date value regardless of how the date is formatted on these two objects.

     

    Regards

    0
  • Avatar
    Legacy Poster

    Hi Fernando,

    Thank you for your response. I'm still not sure I completely understand how to do what you said, though.

     

    1. When you say to create an object outside of my label, do you mean in the same file but outside the printable area of the label? Or do you mean in another file entirely?

     

    2. When you refer to the "original date format", does it matter what this is? The two date formats I'm looking to use are YYYY-MM-DD (2 fields on the label itself) and YYMMDD (embedded in the barcode).

     

    3. I created a new object and tried to link the above fields (3 locations, including one in the barcode) to the new object, but when I print preview, there is no entry on the label.

     

    4. I believe that I understand the date formatting part, but wondering if I need to have all three dates on the label pointing at an outside field, or if I can enter it as it will be in the barcode and just format it for the other parts of the label.

     

    Thanks!

    Ken

    0
  • Avatar
    Legacy Poster

    Ok, I think I may have figured it out. Can you please look at the updated attachment and see if this looks correct?

     

    Also, is there a way to display the entry field as YYYY-MM-DD, or will it always show today's date or the date that the label was created?

     

    Are there any other (cleaner) ways of accomplishing this, or is this the most straightforward?

     

    Thanks!

    Ken

    0
  • Avatar
    Legacy Poster

    Thank you, this was exactly what I needed.

    0
  • Avatar
    Aaron Prince

    I'd just like to say that not only does this still work, but it was exactly what I needed as well. 

    I think as a future enhancement it would be nicer if you could take a data value and present it however you want, but in a pinch this works fine.

    0
  • Avatar
    Peter Thane

    For dates you can adjust the way it looks by using the Custom option at the bottom and then add the appropriate characters in the Pattern underneath.

    0

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