Subject | TIBOQuery - where to create dynamic TFields? |
---|---|
Author | G. Nau |
Post date | 2007-06-10T19:25:53Z |
I'm using IBO 4.7/FB2.0 with FastReport 4.1x and IBOs TDataset
compatible components.
It's working fine, but for some reasons I can not use the TDataset-fieldeditor
to define additional calculated field.
I'd like to create dynamic tfields for the TIBOQuery using this code fragment:
Procedure TLagerDrucken.Addfields;
VAR vkbrutto: tcurrencyfield;
begin
inherited;
vkbrutto:=TCurrencyField.Create(IBOQuery_Main);
with vkbrutto do
Begin
FieldKind:=fkCalculated;
fieldname:='vkbrutto';
calculated:=True;
DataSet:=IBOQuery_Main;
end;
But which event do I have to use to add these fields?
The only event Fastreport is triggering going into the report designer is the
onprepare event. Adding my AddFields here is adding my field but then I'm
missing all the default fields.
That's of course TDataset default behaviour:
-leave the Fieldeditor empty and TDataset is creating all fields from the
query automatically
-want to use additional fields? Then use the field editor, but in this case
you'll have to add ALL field to the query, too. That's bad, when the query
itself is dynamic.
Any idea to get ALL fields of the query AND add some calculated ones?
Regards
Gunther
compatible components.
It's working fine, but for some reasons I can not use the TDataset-fieldeditor
to define additional calculated field.
I'd like to create dynamic tfields for the TIBOQuery using this code fragment:
Procedure TLagerDrucken.Addfields;
VAR vkbrutto: tcurrencyfield;
begin
inherited;
vkbrutto:=TCurrencyField.Create(IBOQuery_Main);
with vkbrutto do
Begin
FieldKind:=fkCalculated;
fieldname:='vkbrutto';
calculated:=True;
DataSet:=IBOQuery_Main;
end;
But which event do I have to use to add these fields?
The only event Fastreport is triggering going into the report designer is the
onprepare event. Adding my AddFields here is adding my field but then I'm
missing all the default fields.
That's of course TDataset default behaviour:
-leave the Fieldeditor empty and TDataset is creating all fields from the
query automatically
-want to use additional fields? Then use the field editor, but in this case
you'll have to add ALL field to the query, too. That's bad, when the query
itself is dynamic.
Any idea to get ALL fields of the query AND add some calculated ones?
Regards
Gunther