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.
Generally, DataPipelines in ReportBuilder are meant to be used in the following way: "SQLQuery" is not a standard property of the TppDBPipeline object so my guess is the custom DataPipeline attempts to combine the Dataset, Datasource, and DataPipeline into a single component.
If this is the case, you should be able to only update the query itself with the required fields and then let the pipeline populate its field list automatically (assuming AutoCreateFields is True). Then there would be no need to move any pipeline fields.
Of course, this is simply a guess to how the custom pipeline component is meant to function. You may need to dig into the source to understand exactly how it works.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com