I know, that probably won't solve your problem, but I usually get rid of these kind of enumerations in favor of proper ones supported by RTTI. The numerical values are handles by record helpers:
type
TReportTypeCode = (reportTypeCodeSTR, reportTypeCodeLCTR, reportTypeCodeCDR, reportTypeCodeLVCTR, reportTypeCodeEFTR);
TReportTypeCodeHelper = record helper for TReportTypeCode
private
const
cMapping: array[TReportTypeCode] of Integer = (102, 106, 113, 14, 145);
function GetAsInteger: Integer;
procedure SetAsInteger(const Value: Integer);
public
property AsInteger: Integer read GetAsInteger write SetAsInteger;
end;
function TReportTypeCodeHelper.GetAsInteger: Integer;
begin
Result := cMapping[Self];
end;
procedure TReportTypeCodeHelper.SetAsInteger(const Value: Integer);
begin
for var idx := Low(Self) to High(Self) do begin
if cMapping[idx] = Value then begin
Self := idx;
Exit;
end;
end;
raise EInvalidOperation.Create('invalid Integer value for TReportTypeCode');
end;
Now there is no more casting to and from Integers.