Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage return in Code 128

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
I have successfully written a check-digit calculator in Crystal using Code 128 B and the algorithm commonly available.
The scanner is reading the Barcode successfully for all alphanumeric characters.
The issue I have is when I attempt to introduce a Carriage return to the end of the character string.
The scanner itself adds a default return to what is scanned.
However, I need two returns in the particular application, meaning I have to code one return into the barcode string itself.
There is where I am coming unstuck.
Has anyone achieved this ?
Thanks
 
You probably need to jump Code 128 A to get a CR.


Jim Asman
jlasman@telus.net
 
Can u send me a sample of the crystal reports function?
dposton@barcodeone.com

DougP, MCP
 
Shaun,

If it doesn't work with the switch to code A, as Jim suggested above, could you not get your app to add the CR to the string that it reads in?

Something like.... ((very) psuedo code)

FinalBarcode = OriginalBarcode + <CR>

Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
Thanks for your responses to date.
I am beavering away on something else at the moment and will rejoint the effort in a couple of weeks.
In the meantime...this is the Crystal codein full I am using.

stringvar CORECHAR;
stringvar CHECKDIGCHAR;
stringvar CHIMEID := TOTEXT({INDIVIDUAL_CLIENT.individual_client_id});
stringvar RETURN := CHR(13) ;
stringvar BARCODETEXT := CHIMEID & RETURN;

numbervar n;
numbervar i:=1;
numbervar STARTSUB := 103 ;
numbervar CHECKDIGIT:= STARTSUB;

n := length(BARCODETEXT ) ;


FOR I:= 1 TO N DO

IF ASC(MID(BARCODETEXT ,I,1)) = 13 THEN
CHECKDIGIT := CHECKDIGIT + (77 * I) ELSE
CHECKDIGIT:= CHECKDIGIT + ( (ASC(MID(BARCODETEXT ,I,1)) - 32) * I);

CHECKDIGCHAR:= CHR(remainder(CHECKDIGIT,103) + 32);

CORECHAR := BARCODETEXT & CHECKDIGCHAR ;

CORECHAR;
 
You don't need your own code for the 128 barcode checksum. Go to IDAutomation and download their Crystal UFL, which contains functions for formatting and checking barcodes in Crystal Reports. You will need to use the IDAutomation Code 128 font set with their Crystal UFL.

To add a carriage return to the barcoded field, first create a formula field in Crystal and use the IDAutomation 128 function on the field you want to barcode. Then put the formula field into a text box in your report, and add a carriage return at the end. Then change the font on the field and carriage return in the text box to the 128 barcode font you want. The scanner should read the barcoded carriage return. I haven't tested this yet, but I will tomorrow afternoon.


Roz
 
I finally got around to testing the carriage return in the text box, and it doesn't work with font 128 or 3 of 9. Try asking your question of the font supplier.

Roz
 
You can program most all Barcode scanner to add a CR to a specific barcode or all barcodes.
If that will help

DougP, MCP
 
Here's the info from IDAutomation's website on inserting a CR into their 128 barcode font using their Crystal UFL.

It is also possible to combine multiple fields and place functions in a single barcode when using Code 128 in a report. For example the following formula places a tab function and a return function after the barcode:

IDAutomationFontEncoderCode128 ({Table1.DataField1} & CHR(9) & CHR(13), 0)
Use CHR(9) for tab and CHR(13) for a return.


Roz
 
Our timeframe for getting this up and running precludes using the IDAutomation fonts and UFL because of the slowness of our beaurocracy in procuring anything over the net. Aaghhhh !

But from the example above, it is clear that the UFL is including the Tab and Enter characters when calculating the checkdigit sum and character. You can't just tag a CR and Tab on the end once the rest of your characters run thru the Checkdigit process ?

In response to DougP, our scanner all ready includes an embedded CR, but the application calls for two CR's.
One to run the query to find a client after entry of a 5 digit char, and the other to select what is returned from the query in a list.

Also, if you include the CR in the text string of the Barcode, the Barcode splits across two lines - this looks seriously weird and may be why the scanner fails to read it.

I will keep plugging away at the hand-coded stuff for now as we plan to extend the use of the scanner to include Shift+Tab, Alt+A functions as well. Maybe we are too ambitious.
 
NO you need to get over the WEB purchase phobia.

DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top