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
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.