A formula can only return a single variable. Not only that, but you are using "If-Else" statements which means that once the first condition is a success, then it won't even look at the other conditions.
In your example, you are returning a single string based upon the value of one of the fields. If you want to show both values, how do you plan on doing it? The formula can result can be shown once. I suggest concatenating the variables together and separating them with a space (adding a comma at the end gets tricky b/c you might have to strip it off at the end). Here is a quick fix to your formula that might work for you:
StringVar Result;
if ({eC_IRFDetails.ABC}) = 1 then
Result := "Capacity Expansion";
if ({eC_IRFDetails.DEF}) = 1 then
Result := Result + " Productivity" ;
if ({eC_IRFDetails.XYZ}) = 1 then
Result := Result + " Replacement";
Result;
Try this and see if it is the fix you need. I cover programming formulas spanning 3 chapters in my CR Encyclopedia book. You can find out more about my books at
Amazon.com
or reading the
Crystal
Reports eBooks online.