Removing pipeline fields
Hi,
We create a pipeline at runtime
The dataset of the datasource which is connected to the piplines has fields
with property visible set to false.
The user may not choose these fields to be in the report.
Because i can't set pipeline fields visible to false (no such property), i
remove the fields:
with ppDBppln do
begin
for i := FieldCount - 1 downto 0 do
begin
if not Datasource.Dataset.FieldByName(Fields[i].FieldName).Visible
then
begin
RemoveField(Fields[i]);
end;
end
end;
This works fine, but when i close my form from which i started all this, i
get an access violation.
When i have no fields visible = false, there is no av.
Eric
We create a pipeline at runtime
The dataset of the datasource which is connected to the piplines has fields
with property visible set to false.
The user may not choose these fields to be in the report.
Because i can't set pipeline fields visible to false (no such property), i
remove the fields:
with ppDBppln do
begin
for i := FieldCount - 1 downto 0 do
begin
if not Datasource.Dataset.FieldByName(Fields[i].FieldName).Visible
then
begin
RemoveField(Fields[i]);
end;
end
end;
This works fine, but when i close my form from which i started all this, i
get an access violation.
When i have no fields visible = false, there is no av.
Eric
This discussion has been closed.
Comments
Eric
To remove a TppField from a TppDataPipeline, set Field.DataPipeline to nil
(internally DataPipeline.RemoveField will be called, do not call this method
directly.)
Example:
myPipeline.Fields[i].DataPipeline := nil;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks. Setting "Selectable" also worked fine for me.
Eric