I am trying to do a calculation in my report on a field that may not exist in the pipeline. If the field doesn't exist, then I want to calculate against a field that I know does exist. Anyone have any suggestions?
You can query which fields do exist in the data pipeline by accesing it's Fields array property. For example:
while not(lbFieldExists) and (liIndex < ppReport1.DataPipeline.FieldCount) do begin lbFieldExists := (ppReport1.DataPipeline.Fields[liIndex].FieldName = aFieldName); // or FieldAlias Inc(liIndex); end;
Comments
what environment are you using?
regards,
Chris Ueberall;
You can create a calculated field in Delphi filled with the data of the one
that exists.
regards,
Chris Ueberall;
Fields array property. For example:
while not(lbFieldExists) and (liIndex < ppReport1.DataPipeline.FieldCount)
do
begin
lbFieldExists := (ppReport1.DataPipeline.Fields[liIndex].FieldName =
aFieldName); // or FieldAlias
Inc(liIndex);
end;
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com