freebie82
6th January 2010, 23:24
Trying to print barcodes on a type-3 report.
On detail.1, i have 6 fields. FIELD-1 and FIELD-4 are supposed to be printed as barcode.
I have set typeXX files properly.
When it prints, FIELD-1 and FIELD-4 barcode prints in the same position of FIELD -1. (FIELD-4 Barcode prints at the bottom of FIELD-1).
I tried manipulating the typeXX files, but even after multiple trials, FIELD-4 still prints barcode under FIELD-1 and not at FIELD-4.
I use HP Printer to do it.
Below i try to describe how my report looks now. (wrong one)
(barcode)
|||||||||||||||||
FIELD-1
|||||||||||||||||
FIELD-4
Instead of
||||||||||||| |||||||||||||
FIELD-1 FIELD-4
Does anyone have any suggestions /tips to resolve?
Thanks.
Freebie.
günther
12th January 2010, 10:58
First: What's your OS?
Could you post your typeXX script so that I could have a look at it?
Günther
freebie82
12th January 2010, 16:24
Hi Gunther -
Please see my baan implementation details. Also pasting down my typeXX file.
Product ver.: 6.1c.07.21
Port no. : PA.3750
Date : Mon Nov 3 16:50:08 NFT 2008
Uname : AIX nlbaubd4 2 5 00C773EC4C00
Machine-id : IBM_RS6000
OS-release : AIX5.2
|**************** Pasting Below my TYPEXX file*************************
#!/bin/sh
#******************************************************************************
# @(#)
# @(#) File : type05
# @(#)
# @(#) Printer : HP LaserJet 5
# @(#) Emulation Mode : HP
# @(#) Character Set : -
# @(#)
# @(#)
# @(#)
# @(#)
# @(#)
# @(#)
#******************************************************************************
cat /Baan/BaanIVc/bse/templates/bc_C39HS14
strln='echo "*$1*" |awk '{printf "%d",length}''
i = 1
#code="*$1*"
code="($1)"
#while [$i -le ${strlen}]
#do
# teilstr='echo "*$1*" | cut -c $i -$i'
# if [ "${teilstr}" = " "]; then
# teilstr = "_"
# fi
# code = "${code}${teilstr}"
# i='expr $i + 1'
#done
height=$2
Push()
{
# push cursor position (max 20x)
echo "\033&f0S\c"
}
Pop()
{
# pop cursor position
echo "\033&f1S\c"
}
NextRow()
{
# move to next row, relative
echo "\033&a+1R\c"
}
# - save cursor position - filter assumes same position after barcode print
Push
# - select Code39 font
#echo "\033(25501X\c"
echo "\033(70X\c"
# - move x+55 dots
echo "\033*p+55X\c"
# echo "$code\c"
echo "$code\c" | tr -d " "
#while [ $height -gt 1 ]
#do
# Push
# echo "$code\c"
# Pop
# NextRow
# height=`expr $height - 1`
#done
# - select Courier Bold 12 cpi
#echo "\033(12U\033(s0p12h0s3b4099T\c"
# \033 --> escape sequqnce
# (12U --> Select the symbol set
# 0p --> Fixed spacing
# 12h --> pitch of 12
# 0S --> Style ( upright solid )
# 3b --> Stroke weight ( 3 ---> bold )
# 4099T --> Typeface family ( Body Text - default )
# - select the default font
echo "\033(3@\c"
# - restore cursor position for filter
Pop
exit 0
günther
12th January 2010, 17:57
Hi,
well thats lots of comments and unused code (strln=`...` + not the typo, NextRow() etc).
What I see:
1. You download a softfont by cat /Baan/BaanIVc/bse/templates/bc_C39HS14.
2. You select that softfont by echo "\033(70X\c".
3. You (try to) select the previous font by echo "\033(3@\c"; please check that.
4. The functions Push() and Pop look okay.
5. You print the barcode by echo "$code\c" | tr -d " ", i.e. no blanks in barcode; okay.
What I don't understand:
1. Why do you have to position by echo "\033*p+55X\c"?
I would suggest as test:
Try it without positioning in this script (and maybe clean this script!). Move the barcode fields in the report layout so that they are clearly separateted, and enclose each field by eg. [ and ].
Günther
freebie82
12th January 2010, 18:35
hi Günther
Appreciate yor reply.
Still i face the error. I have attached a pdf file with o/p barcode printing. Two different barcodes prints at same place top and bottom
Also pasted below is modified typexx file.
|************
cat /Baan/BaanIVc/bse/templates/bc_C39HS14
code="($1)"
height=$2
Push()
{
# push cursor position (max 20x)
echo "\033&f0S\c"
}
Pop()
{
# pop cursor position
echo "\033&f1S\c"
}
NextRow()
{
# move to next row, relative
echo "\033&a+1R\c"
}
# - save cursor position - filter assumes same position after barcode print
Push
# - select Code39 font
echo "\033(70X\c"
# - move x+55 dots
# echo "$code\c"
echo "$code\c" | tr -d " "
# - select the default font
# - restore cursor position for filter
Pop
exit 0
|************
Apprecaiate yor comments on this problem.
günther
13th January 2010, 10:03
I've created a simple report, three fields with constant text "00001" to "00003" (each barcode 50) and I've setup a type50 script like yours.
The result was wrong; after a barcode, the cursor position was too low.
Then I deleted the line that downloads the barcode font (cat /Baan/BaanIVc/bse/templates/bc_C39HS14), and then it was okay!
So could you test please: First print one as before, then comment out your download line, and it shold be okay.
Günther
freebie82
28th January 2010, 20:24
Thanks Gunther.
Code 39 works butter. Any chance having a typexx file for code 128?
I manipulate for code 128, but it does not print barcode.
Appreciated.
bdittmar
29th January 2010, 14:01
Thanks Gunther.
Code 39 works butter. Any chance having a typexx file for code 128?
I manipulate for code 128, but it does not print barcode.
Appreciated.
Hello,
This script uses BC128 autoswitch.
-----------------------------------
#!/bin/sh
# LTi DRiVES GmbH - November 2002 B. Dittmar
# Barcode zum Drucken von Sonderzeichen!
# Identisch mit type04 (BD20070918)
# push cursor
echo "\033&f0S\c"
# laenge=`echo $1 | awk '{ print rlength($1) }'`
# cat laenge > /tmp/test.txt
#CODE 128 autoswitch
echo "\033(10Q\033(s1p15vsb24700T\c"
echo "\033&p15X\c"
echo "$1"
# echo "\033(10U\033(s0p12.00h10.0v0s0b4102T\c"
# pop cursor position
echo "\033&f1S\c"
Regards
freebie82
29th January 2010, 15:19
Thanks Bernd -
How do you encode data before sending it for printing via baan report?
Also, do you calculate checksum for the data before you send for printing?
Thanks
Freebie.