Finding the value from the TField of a TppDBComponent
Hi,
I have a report including TmyDBCheckBox, and TppDBText components. I would
like to use the OnPrint event to change the components visible property
depending on what the value is within the field it relates to.
I will have many components, referring to the same code, so I do not want to
call a variable directly. I would prefer to use the Sender variable sent by
the event.
Is it possible to do this?
ie: something like
myvalue :=
TppDBText(sender).pipeline.datasource.dataset.findfield(TppDBText(sender).Datafield).value;
(This obviously doesn't work).
Thanks & Regards
Adam.
I have a report including TmyDBCheckBox, and TppDBText components. I would
like to use the OnPrint event to change the components visible property
depending on what the value is within the field it relates to.
I will have many components, referring to the same code, so I do not want to
call a variable directly. I would prefer to use the Sender variable sent by
the event.
Is it possible to do this?
ie: something like
myvalue :=
TppDBText(sender).pipeline.datasource.dataset.findfield(TppDBText(sender).Datafield).value;
(This obviously doesn't work).
Thanks & Regards
Adam.
This discussion has been closed.
Comments
If you are using the OnPrint event of the DBText, the current record should
be accessable directly from the database. For instance, you could say...
MyValue := ppReport1.DataPipeline[TppDBText(Sender).DataField];
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Best Regards
Adam