Data.DB.TField OnGetText

Here is a small sample of code I use. This is not code form our commercial app but a sample of working code.

I assign the OnGetText of many fields from queries to a procedure to handle the formatting of the data from those fields.

Here is a sample of the code.

queryDatasource.DataSet:= query;
query.FieldByName('myfield').OnGetText:= OnGetFieldText;

procedure TMyForm.OnGetFieldText(Sender:TField; var Text:String; DisplayText:Boolean);
begin
Text:= Sender.AsString;
Text:= 'My Extra Text '+Text;
end;

If I attach the TDataSource queryDatasource to a datagrid.Datasource the procedure OnGetText is called. If I assign the TDataSource queryDatasource to the TfrxDBDataset.Datasource for my report OnGetText event is never called and the data from the field is presented to the report straight from the database.

The TfrxDBDataset doesn't seem to allow for the OnGetText event. What am I missing?

Thank you in advance!

Comments

  • gpigpi
    edited 1:45AM
    wrote:
    The TfrxDBDataset doesn't seem to allow for the OnGetText event.
    Yes, the TfrxDBDataset doesn't supports the OnGetText event.
  • edited 1:45AM
    gpi wrote: »
    Yes, the TfrxDBDataset doesn't supports the OnGetText event.
    Ok thanks. Will it at some point? What would be a sensible workaround?

Leave a Comment