Using Crystal 10 with Microsoft SQL Server and the ERP package of Microsoft Dynamics GP.
All information in the item database is stored in uppercase. For this particular crystal report we do not want all uppercase so I am using the propercase function first. When I use the propercase some initials and abbreviations are changed and should not be (ex. Gps should be GPS and Mci should be MCI). To combat that issue I am using this formula:
WhilePrintingRecords;
StringVar NotesVar;
NotesVar := propercase({CSC42100.ivdef6});
If InStr(NotesVar, "7Tz") > 0
then
Replace(Propercase(NotesVar), "7Tz", "7TZ")
else
If InStr(NotesVar, "10Ra") > 0
then
Replace(Propercase(NotesVar), "10Ra", "10RA")
else
If InStr(NotesVar, "10Rb") > 0
then
Replace(Propercase(NotesVar), "10Rb", "10RB")
else
If InStr(NotesVar, "7Rb") > 0
then
Replace(Propercase(NotesVar), "7Rb", "7RB")
else
If InStr(NotesVar, "Md") > 0
then
Replace(Propercase(NotesVar), "Md", "MD")
else
If InStr(NotesVar, "W/O") > 0
then
Replace(Propercase(NotesVar), "W/O", "w/o")
else
If InStr(NotesVar, " With") > 0
then
Replace(Propercase(NotesVar), " With", " with")
else
If InStr(NotesVar, "Rz") > 0
then
Replace(Propercase(NotesVar), "Rz", "RZ")
else
If InStr(NotesVar, "Or") > 0
then
Replace(Propercase(NotesVar), "Or", "or")
else
If InStr(NotesVar, "Non-T.S.O.'D") > 0
then
Replace(Propercase(NotesVar), "Non-T.S.O.'D", "Non-T.S.O.'d")
else
If InStr(NotesVar, "See New") > 0
then
Replace(Propercase(NotesVar), "See New", "Replace w/ new")
else
If InStr(NotesVar, "Replace With New") > 0
then
Replace(Propercase(NotesVar), "Replace With New", "Replace with New")
else
If InStr(NotesVar, "Replace w/ new") > 0
then
Replace(Propercase(NotesVar), "Replace w/ new", "Replace with New")
else
If InStr(NotesVar, "Atc") > 0
then
Replace(Propercase(NotesVar), "Atc", "ATC")
else
If InStr(NotesVar, "Mci") > 0
then
Replace(Propercase(NotesVar), "Mci", "MCI")
else
If InStr(NotesVar, "Gps") > 0
then
Replace(Propercase(NotesVar), "Gps", "GPS")
ELSE
Propercase(NotesVar)
The problem is is that if the line has more than one of these instances in it it only changes the first instance. For example: Use test or use Mci
This happens b/c the statement using "or" happens before "Mci".
How can I have it change all instances?
Thanks!
All information in the item database is stored in uppercase. For this particular crystal report we do not want all uppercase so I am using the propercase function first. When I use the propercase some initials and abbreviations are changed and should not be (ex. Gps should be GPS and Mci should be MCI). To combat that issue I am using this formula:
WhilePrintingRecords;
StringVar NotesVar;
NotesVar := propercase({CSC42100.ivdef6});
If InStr(NotesVar, "7Tz") > 0
then
Replace(Propercase(NotesVar), "7Tz", "7TZ")
else
If InStr(NotesVar, "10Ra") > 0
then
Replace(Propercase(NotesVar), "10Ra", "10RA")
else
If InStr(NotesVar, "10Rb") > 0
then
Replace(Propercase(NotesVar), "10Rb", "10RB")
else
If InStr(NotesVar, "7Rb") > 0
then
Replace(Propercase(NotesVar), "7Rb", "7RB")
else
If InStr(NotesVar, "Md") > 0
then
Replace(Propercase(NotesVar), "Md", "MD")
else
If InStr(NotesVar, "W/O") > 0
then
Replace(Propercase(NotesVar), "W/O", "w/o")
else
If InStr(NotesVar, " With") > 0
then
Replace(Propercase(NotesVar), " With", " with")
else
If InStr(NotesVar, "Rz") > 0
then
Replace(Propercase(NotesVar), "Rz", "RZ")
else
If InStr(NotesVar, "Or") > 0
then
Replace(Propercase(NotesVar), "Or", "or")
else
If InStr(NotesVar, "Non-T.S.O.'D") > 0
then
Replace(Propercase(NotesVar), "Non-T.S.O.'D", "Non-T.S.O.'d")
else
If InStr(NotesVar, "See New") > 0
then
Replace(Propercase(NotesVar), "See New", "Replace w/ new")
else
If InStr(NotesVar, "Replace With New") > 0
then
Replace(Propercase(NotesVar), "Replace With New", "Replace with New")
else
If InStr(NotesVar, "Replace w/ new") > 0
then
Replace(Propercase(NotesVar), "Replace w/ new", "Replace with New")
else
If InStr(NotesVar, "Atc") > 0
then
Replace(Propercase(NotesVar), "Atc", "ATC")
else
If InStr(NotesVar, "Mci") > 0
then
Replace(Propercase(NotesVar), "Mci", "MCI")
else
If InStr(NotesVar, "Gps") > 0
then
Replace(Propercase(NotesVar), "Gps", "GPS")
ELSE
Propercase(NotesVar)
The problem is is that if the line has more than one of these instances in it it only changes the first instance. For example: Use test or use Mci
This happens b/c the statement using "or" happens before "Mci".
How can I have it change all instances?
Thanks!