Skip to Content

Replacing multiple strings within a field

Hi there

I want to replace certain strings in a field with an italicised alternative. I've got the Italics working, but it seems that Crystal doesn't want to do it more than once per record.

I am attaching a screenshot of the formula I'm using and also the output that I am getting. You will see that only one of the values is being replaced as required. This is an example of only two of the output label blocks, representing two records.

Does anyone know how I can set up my replace formula so that all of the required replacements can be done for each record?

thanks

Karen

italicreplacementformula.jpgitalicreplacementoutput.jpg

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 22 at 02:49 PM

    You are probably doing multiple replace attempts on the original data. So only the last replace attempt can have any impact.
    Instead, load the first replace result into a string variable, and target that result variable for all future replace attempts.

    Add comment
    10|10000 characters needed characters exceeded

  • May 22 at 05:30 AM

    Another note:

    One thing I am about to try is to simply replace all the relevant values in the data with HTML italics tags, with the field set to HTML format... hopefully that will do away with the whole formula problem altogether.. watch this space.

    cheers

    Karen

    Add comment
    10|10000 characters needed characters exceeded

    • Problem solved! I just tagged the requested strings with HTML italic tags and formatted the field as HTML.... et voila!

      This is not ideal under normal circumstances, because we wouldn't want HTML tags in our normal data, but this data is for a special project, so this is the best solution!

      cheers

      Karen