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

Moving fields between pipelines

Hello,

We have our own Pipeline inherited from TppCustomDataPipeline. I am not the author.

I need to go through all our reports and move some fields from one pipeline to another. The fields are in both data sources.
I do this with the following code. It seems to work. When I open Designer, I can see the fields there. However, after Preview, they disappear. They are not part of SQL.
When I do the same thing in Designer, it works. I'm missing some refresh call there. I can't figure out which one.

Can you please advise me?

Thanks, Jan

var LI := AOldPipeline.IndexOfFieldName(AFieldName); if LI > -1 then begin var LField := AOldPipeline.Fields[LI]; LI := ANewPipeLine.DefineField(LField.FieldName, LField.DataType, LField.FieldLength); AOldPipeline.RemoveField(LField); end;

Comments

  • Hi Jan,

    Rather than defining new fields for the new pipeline, try re-assigning the Datapipeline property of the existing fields. Be sure the AutoCreateFields property is set to False for the new pipeline.

    Something like the following:
    ppDBPipeline2.AutoCreateFields := False;

    ppDBPipeline1.GetFieldForName('Field1').DataPipeline := ppDBPipeline2;
    ppDBPipeline1.GetFieldForName('Field2').DataPipeline := ppDBPipeline2;
    ppDBPipeline1.GetFieldForName('Field3').DataPipeline := ppDBPipeline2;
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
Sign In or Register to comment.