Is it possible to use the name of a Crystal Reports formula inside the formula itself (in Crystal 8.5)?
For example, assume I have formulas such as:
@MOISTURE
@PROTEIN
@ACIDITY
@PROPERTYX
@PROPERTYY
@PROPERTYZ
and that the logic for each formula is identical. The only difference between the formulas is the name of the field they ultimately access. For exmaple, @MOISTURE looks like this:
if ... then {VIEW_SPECS.SOURCE_1_MOISTURE}
if ... then {VIEW_SPECS.SOURCE_2_MOISTURE}
if ... then {VIEW_SPECS.SOURCE_3_MOISTURE}
if ... then {VIEW_SPECS.AVERAGE_MOISTURE}
and @PROTEIN looks like this:
if ... then {VIEW_SPECS.SOURCE_1_PROTEIN}
if ... then {VIEW_SPECS.SOURCE_2_PROTEIN}
if ... then {VIEW_SPECS.SOURCE_3_PROTEIN}
if ... then {VIEW_SPECS.AVERAGE_PROTEIN}
Instead of typing out all this repetetive stuff for each formula, can I get the name of the formula in the formula itself, so that each formula would look something like this:
if ... then {VIEW_SPECS.SOURCE_1_{$this}}
if ... then {VIEW_SPECS.SOURCE_2_{$this}}
if ... then {VIEW_SPECS.SOURCE_3_{$this}}
if ... then {VIEW_SPECS.AVERAGE_{$this}}
I want to be able to write the formula once, and paste it into the Formula Editor for each of the formulas, without having to modify each one.