I know how convert something to proper case, i.e., MRS. JONES, CPA to Mrs. Jones, Cpa. But I would like to have a list of exceptions that would not be converted, in the example, CPA should not be converted, any ideas?
I like SV's approach except that it isn't really complete...for example: What if we had CPA, CPa, Cpa or cpa
these are 4 different searches when only one is needed.
Also you can set up an array in a formula hidden in the report header to assign not only the search criteria but also the replacement value....I'll show you.
Let us say we want the following spellings to be exactly like this
PhD, CPA, BSc
Create an assignment formula
******************************************
@ExactSpellings (place suppressed in the report header)
WhilePrintingRecords;
stringVar array spellings := ["PhD","CPA","BSc"];
//add this since the result of a formula cannot be an array
" ";
******************************************
Now in the formula that prints the name or whatever do this
for icount := 1 to ubound(spellings) do
(
iPos := instr(uppercase(Myfield),
uppercase(spellings[icount]))
if iPos <> 0 then
Myfield := left(Myfield,iPos -1) +
spellings[icount] +
right(Myfield,length(Myfield) -
iPos - length(spellings[icount]) + 1);
//if you are only replacing one exception
//you could "Exit For" at this point By adding it to
//a block of if statements above
);
Myfield;
******************************************
this would have to be modified if there was more than one instance of the exception in a field but it doesn't look to be the case here.
There you go...only maintenance required is to the @ExactSpellings formula in the report header....I would personally use a background of red so that it sticks out in design (the formula would have a conditional suppress using the formula
1 = 1
This way it always suppresses but Crystal will maintain the color in design.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.