Show/Hide Toolbars

TMS Aurelius Documentation

You can use calculated fields in TAureliusDataset the same way with any other dataset. Note that when calculating fields, you can use regular Dataset.FieldByName approach, or you can use Current<T> property and access the object properties directly.

 

procedure TForm1.AureliusDataset1CalcFields(Dataset: TDataset);

begin

  if AureliusDataset1.FieldByName('Birthday').IsNull then

    AureliusDataset1.FieldByName('BirthdayText').AsString := 'not specified'

  else

    AureliusDataset1.FieldByName('BirthdayText').AsString := DateToStr(AureliusDataset1.FieldByName('Birthday').AsDateTime);

 

  case AureliusDataset1.Current<TCustomer>.Sex of

    tsMale:

      AureliusDataset1.FieldByName('SexDescription').AsString := 'male';

    tsFemale:

      AureliusDataset1.FieldByName('SexDescription').AsString := 'female';

  end;

end;