toletofhitachi
8th May 2007, 05:54
When I try to extract text field of PO text using Crystal Report, it shows up gibberish. I don't have Baan Native driver installed. Any one with suggestions?

Thank you.

Regards,
Danny Kat

sukesh75
8th May 2007, 08:45
You would have to convert the data in the text field to either char or varchar.

sk

toletofhitachi
8th May 2007, 12:23
Hi,

thanks for your reply.

Have you any idea how you do that in Crystal Report?

Thank you.

Regards,
Danny Kat

sukesh75
8th May 2007, 12:27
I have not worked with crystal report but then a crystal report would be based on a stored procedure or a view i guess? You could do this conversion in either of them..
Alternatively, I do beleive there is a datatype conversion method in VB, i.e if you are using VB codes behind this report..

sk

SMORES
18th May 2007, 19:44
Not sure if this will help you, but it has worked for us in Crystal 8.5. I set up the following formula in Crystal using Basic Syntax. Please note to change the table references in the formula when necessary.

Dim var1, var2
Dim val1, val2
Dim x
Dim text

text = ""

for x = 1 to len({ttttxt010100.t_text}) step 2
var1 = mid({ttttxt010100.t_text}, x, 1)
select case var1
case "A"
var1 = "10"
case "B"
var1 = "11"
case "C"
var1 = "12"
case "D"
var1 = "13"
case "E"
var1 = "14"
case "F"
var1 = "15"
case else
var1 = var1
end select

val1 = val(var1) * 16

var2 = mid({ttttxt010100.t_text}, x+1, 1)

select case var2
case "A"
var2 = "10"
case "B"
var2 = "11"
case "C"
var2 = "12"
case "D"
var2 = "13"
case "E"
var2 = "14"
case "F"
var2 = "15"
case else
var2 = var2
end select

val2 = val(var2)
text = text + chr(val1+val2)

next x

formula = text

toletofhitachi
22nd May 2007, 04:12
Hi SMORES,

thanks very much for the coding. Will try it in Crystal later.

Regards,
Danny

SMORES
22nd May 2007, 14:25
No problem Danny!
Please let me know if it works.