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 1:59AM
    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.
  • just drop the field on the form and type

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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.