Print Page | Close Window

convert symbols in data to unicode characters

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=16782
Printed Date: 11 May 2024 at 3:59am


Topic: convert symbols in data to unicode characters
Posted By: tucker2m
Subject: convert symbols in data to unicode characters
Date Posted: 18 Jun 2012 at 9:39am

Greetings everyone,

Our database does not currently support unicode.  We have been testing it out and keep finding issues with it, so until the issues can be resolved, we have opted out of enabling this function. 
In the mean time, we are using the following character " ^ " before the letters "o" and "u" to indicate there should be a line above the letter (unicode equivalent of ō and ū).  The problem is then in our reporting functions.  I am having issues with the correct formula to use to convert ^o to ō and ^u to ū in the final report. 
 
For the fields where the letter with the symbol appear, I am already using a formula to select the data, so I have to figure out where I can add a new formula to convert the symbol into the unicode character.  I have tried to add a formula on the font field under the format field section, but the different formulas I have tried do not work.  I keep getting prompts that the rest of the formula is missing or that the formula must be a string.  I have also selected an Arial Unicode MS font with the hopes that once I can figure out how to convert the characters to unicode that the font will not cause any issues.
 
Does anyone else use unicode characters in reports and in their data?  Any suggestions on where to try to add formulas to replace text with unicode characters? 
 
Any help is much appreciated.  Thanks.



Replies:
Posted By: lockwelle
Date Posted: 19 Jun 2012 at 2:50am
i would think that you would a Replace function, so if you have this code 'everywhere' you might want to think of a common function for the report, then you would have a 'simpler' set of formulas...but you would still need a formula for each field in the data that you have the code.
 
never used unicode, but I would think that the general format of the formula would be:
replace("^o", unicode)
 
HTH


Posted By: tucker2m
Date Posted: 19 Jun 2012 at 5:37am

I have tried the replace function, but crystal sees the symbol "^" used before the letter as code and then indicates that I am missing a parenthesis at the end of the formula.   Here is the formula I used in the font field:

replace ("^o"); ChrW (014D)
 
Crystal reports there is an error with this and that it is missing the parenthesis after the D.   Thanks for the input.
 


Posted By: lockwelle
Date Posted: 19 Jun 2012 at 6:23am
should be:
replace ("^o",ChrW (014D))
 
I am not sure how Crystal will interpret 014d...if it is a hex number, convert it to integer (333)


Posted By: tucker2m
Date Posted: 13 Aug 2012 at 7:52am
Hm, I can't seem to get it to work regardless of how I change the code.  Perhaps Crystal Reports XI doesn't support it. 



Print Page | Close Window