Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Removing pipeline fields

edited December 2005 in General
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

Comments

  • edited December 2005
    Perhaps it's better to set 'Selectable" to false

    Eric

  • edited December 2005

    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
  • edited December 2005
    Hi nard,

    Thanks. Setting "Selectable" also worked fine for me.

    Eric

This discussion has been closed.