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
  • Thanks for the advice, but unfortunately it doesn't work.

    The query in NewPipeline.SQLQuery does not contain the new fields. I tried to build the query manually with the new fields and assign it, but that didn't help either. After opening the report, it's still the same. The Pipeline preview looks like the fields are there, but they're not in the SQL, and when I click Preview, they disappear.

    I think the error is somewhere in our Pipeline implementation. My predecessor wrote it, and I'm not very familiar with it.
Sign In or Register to comment.