How i change data at runtime?

when i query data from database it show like below

Name Sex
Jack 1
Halean 0
Tom 1
Bon 1
Eva 0

how i change sex value from 1 to "male" and 0 to "female"

i try to code in onbeforeprint like this

var
tmpMemo: TfrxMemoView;
begin
tmpMemo := frxReport1.FindObject('memoSex') as TfrxMemoView;
if query1.fieldbyname('sex').AsInteger = 1 then
tmpMemo.Text := 'male'
else
tmpMemo.Text := 'female';
end;

compile and run it not work 'cause in memoSex filed in report it always
show 1 or 0

how can i do?

Comments

  • edited 10:59PM
    I'm not exactly sure how to do this in Fast Reports but you might look at using the TField.GetText function where you can do that kind of field manipulation.
  • edited 10:59PM
    just drop the field on the form and type

    [Iif(dbfield."sex"=1,'male','female')]

Leave a Comment