Ziggy Saabel
1st September 2011, 03:22
Hello,
I'm looking for a way of separating each digit of a date field in a report script. Each digit can than be printed and positioned separately.
Background:
=========
we need to print cheques on new pre-printed cheque forms provided by a bank in Thailand. One of the bank requirements is to print each digit of the date field into pre-printed squares (each box is 5x5mm and there are eight boxes to be filled with one digit each ; the date format is ddmmyyyy ; report to print actual cheques is tfcmg126031001).
How can that be done? Do you happen to have sample code?
Your assistance will be very much appreciated.
Cheers
Ziggy
manish_patel
1st September 2011, 09:26
You can use utc.to.date() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_date_time_zones_utc_to_date) function for your requirement...
bdittmar
1st September 2011, 10:22
Hello,
I'm looking for a way of separating each digit of a date field in a report script. Each digit can than be printed and positioned separately.
Background:
=========
we need to print cheques on new pre-printed cheque forms provided by a bank in Thailand. One of the bank requirements is to print each digit of the date field into pre-printed squares (each box is 5x5mm and there are eight boxes to be filled with one digit each ; the date format is ddmmyyyy ; report to print actual cheques is tfcmg126031001).
How can that be done? Do you happen to have sample code?
Your assistance will be very much appreciated.
Cheers
Ziggy
Hello,
use sprintf() and split the resulting string for your needs.
UTC dates and times
| Date format 002 is "year/month/day in month"
| Time format 001 is "12 hour format:minutes:seconds AM/PM symbol"
string result(80)
result = sprintf$("%u002 %001", utc.num(), utc.num())
| Result contains "1997/01/01 10:02:53 pm"
string result(80)
result = sprintf$("UTC: %u(%02d/%02m/%04Y) %U(%02h%x%02m%x%025 %a)", utc.num(), utc.num())
| result contains "UTC: 22/07/1997 06:24:53 am"
| provided that for the user's language the time
| separator is ":" and the AM symbol is "am"
| Using a comma after a %u substitution symbol
string result(80)
result = sprintf$(", ,Message text....", utc.now())
| result containts "06-05-15,Message text...."
Like:
string datedigit1(1)
string datedigit2(1)
string datedigit3(1)
string datedigit4(1)
.... to 8
if result variable is like 01011999
datedigit1 = result(1;1)
datedigit2 = result(2;1)
datedigit3 = result(3;1)
a.s.o.
So the digits can be placed seperately at report.
Regards
Ziggy Saabel
2nd September 2011, 02:47
Wwwhow, thanks for that Bernd! I'll give it a shot!
Cheers
Ziggy
Ziggy Saabel
14th September 2011, 07:32
Hello Bernd,
All done and in production! Thanks again! Please give me a ring if you happen to be in Melbourne +61 (3) 9616 9716. Lunch will be on me!
Cheers
Ziggy