Hi,
[Crystal Reports 2008]
There's a field in the database I'm writing my report against that has multiple values in a single string that are separated by a semi-colon (
. This field is populated by a list box that has check boxes in it.
When the values are added to the table, the full string is used to identify it. In the report I'm writing, I won't have room for the entire string, so I want to change the values to abbreviations.
So, if I have the following in the table:
Asthma
Diabetes
Heart Condition
Weight Reduction
And it appears like the following when I include the field on a report:
Asthma;Diabetes;Heart Condition;Weight Reduction
And want them to appear as the following on my report:
AS DI HC WR
How would I go about doing this? I thought about using the Instr and Replace functions in a nested If statement, but that will only replace one item at a time. Then I thought about using a loop, but I don't have a lot of experience using loops in Crystal Reports and am somewhat hesitant. I also thought about using two arrays and comparing the values at each position, but I can't guarantee that the values will always appear in the same position in the string.
If anyone can help, I would really appreciate it.
Thanks,
beacon
[Crystal Reports 2008]
There's a field in the database I'm writing my report against that has multiple values in a single string that are separated by a semi-colon (
When the values are added to the table, the full string is used to identify it. In the report I'm writing, I won't have room for the entire string, so I want to change the values to abbreviations.
So, if I have the following in the table:
Asthma
Diabetes
Heart Condition
Weight Reduction
And it appears like the following when I include the field on a report:
Asthma;Diabetes;Heart Condition;Weight Reduction
And want them to appear as the following on my report:
AS DI HC WR
How would I go about doing this? I thought about using the Instr and Replace functions in a nested If statement, but that will only replace one item at a time. Then I thought about using a loop, but I don't have a lot of experience using loops in Crystal Reports and am somewhat hesitant. I also thought about using two arrays and comparing the values at each position, but I can't guarantee that the values will always appear in the same position in the string.
If anyone can help, I would really appreciate it.
Thanks,
beacon