Input variable - to show in different output formats

Issues related to label design (working with databases, data processing, RFID encoding etc.) and printing (from NiceLabel Express, NiceLabel Pro, NiceForm and NicePrint)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
KLewisBPM
Enthusiast
Posts: 9
Joined: Mon Jun 11, 2007 12:21 pm

Input variable - to show in different output formats

Post by KLewisBPM » Fri Jul 27, 2007 11:47 am

I have an input value variable called f_RcptDate it is the format DD/MM/YY I can set the variable to output in YYMMDD which is great for barcodes however I want to also show the same date on the label in its original format DD/MM/YY.

User avatar
lpatty
NiceLabel
NiceLabel
Posts: 60
Joined: Mon Sep 11, 2006 4:15 pm
Location: Milwaukee, WI
Contact:

Post by lpatty » Thu Aug 09, 2007 11:49 pm

Since you are swapping the day and year between the two fields, this complicates things. If you were not swapping the values and simply wanted to remove the "/" characters, you could do a simple Replace() expression on one of the fields.

The easiest method in your case would be to create two Date variables on the label. They will both draw from the same source (system clock), but have different output formatting.

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2974
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Post by Saso » Fri Aug 10, 2007 8:38 am

The problem might occur, when the variable f_RcptDate does not receive the value from the system clock, but it receives a value from the database or keyboard entry. In this case you have to duplicate the variable value inside the label.

I see two possibilities.

A quick solution is available with the function 'Visual Basic Script', where you can take input from the existing variable and re-format the output of a new function-generated variable. However not everybody feels comfortable working with VB scripts.

That's why the following workaround can be used:
  1. Create a new function of a type 'Concatenate'.
  2. Select just the variable r_RcptDate for the function output. This way you will actually duplicate the value of the variable r_RcptDate and save it into the variable 'Concatenate'.
    Of course, you can change the name of the output variable.
  3. Open the properties of the new function-generated variable 'Concatenate'.
  4. Change the date format to the desired type.
Saso Fleiser
Senior Technical Product Specialist

jayhonk
Newcomer
Posts: 1
Joined: Thu May 06, 2010 7:09 pm

Re: Input variable - to show in different output formats

Post by jayhonk » Thu May 06, 2010 7:25 pm

So you just concatenate the first variable with nothing and call this the 2nd variable?
That's a good trick.
Is this still the best way?

I have a similar situation. My form asks for user input of the quantity in the box. On the label it gets printed out twice: one as a barcode with prefix and suffix, a second time as just a number.
So I want to enter QtyHuman, and duplicate this into QtyBarCode, then print them out differently.
QtyHuman = 50
QtyBarCode = Q0050C.
Will your trick work?

(Sorry for posting on an old thread, if that is not what I am supposed to do...)

George P.

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2974
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Re: Input variable - to show in different output formats

Post by Saso » Fri May 07, 2010 9:26 am

I would use the same trick with the Concatenate function to create a variable copy and the add prefix/suffix to this copy.

It's the quickest and easiest method... :)
Saso Fleiser
Senior Technical Product Specialist

Post Reply