on ‎2021 Sep 29 7:58 AM
Hi. I'm a total newbie to Crystal reports, so don't be surprised if my question is very basic.
I'm trying to use a Replace function via the Select Expert's "Formula Workshop". There's a particular value that could occupy a field called "SPEC_RULE". The text that is normally there is not very descriptive, so I would like to use a more descriptive sentence in the report. I see the Replace function is available, but when I've tried to use it I haven't written it properly so far. For example, the "inputString", what is that supposed to be? Is it {MY_TABLE.SPEC_RULE}? When I've written Replace ({MY_TABLE.SPEC_RULE},"Unwanted string","Better string") it gives me an error saying, "The remaining text does not appear to be part of the formula." Here's an example of what I tried:
{PRODUCT.VERSION} = 2 and{PRODUCT_GRADE.VERSION} = 2{PRODUCT_SPEC.SPEC_RULE} = Replace ({PRODUCT_SPEC.SPEC_RULE},"Equal to","% Solids +/- 1 SD")
Request clarification before answering.
You have the Replace function set up correctly. However, the rest of your formula is not so Crystal doesn't know how to parse it. Do you need an "If..Then" like this:
If {PRODUCT.VERSION} = 2 and {PRODUCT_GRADE.VERSION} = 2 then
Replace ({PRODUCT_SPEC.SPEC_RULE},"Equal to","% Solids +/- 1 SD")
else
{PRODUCT_SPEC.SPEC_RULE}Also, you can't set a field equal to a certain value. Instead, your formula will return the value you're looking for and you'll use the formula on the report instead of the field.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.