Print Same Data Source With Different Transforms On Label S’abonner

0
Avatar
Legacy Poster

I am using an embedded data source and need to print the entire string in one part of the label, and a truncated version elsewhere on the label.  Whenever I change the transform on the field, both objects are truncated.  Is there a way to do this without adding another field to my database?

 

I am using Bartender version 10.0.

 

Thanks,

8 commentaires

0
Avatar
Fernando Ramos Miracle
Modérateur
Actions pour les commentaires Permalien

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
Actions pour les commentaires Permalien

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
Modérateur
Actions pour les commentaires Permalien

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
Actions pour les commentaires Permalien

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
Modérateur
Actions pour les commentaires Permalien

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
Actions pour les commentaires Permalien

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
Actions pour les commentaires Permalien

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
Actions pour les commentaires Permalien

Thank you, this was exactly what I needed.

Vous devez vous connecter pour laisser un commentaire.