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
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
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:
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com