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 10:27AM
    wrote:
    The TfrxDBDataset doesn't seem to allow for the OnGetText event.
    Yes, the TfrxDBDataset doesn't supports the OnGetText event.
  • edited 10:27AM
    gpi wrote: »
    gpi wrote: »
    The TfrxDBDataset doesn't seem to allow for the OnGetText event.
    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

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.