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

Problem with autosearch fields and multiple data pipelines...

edited November 2001 in General
Hi,

I have a report that has 4 different queries (or data pipelines). All of
these queries have an AutoSearchField named "ADate". However, when I use
AutoSearchCriteriaByName (i.e. AutoSearchCriteriaByName('Query1', 'ADate),
AutoSearchCriteriaByName('Query2', 'ADate), etc.) I always get the
AutoSearchField of the first data pipeline and the other autosearch fields
are never found. I found out the reason was that the autosearch fields were
never assigned a DataPipelineName.

I made the following modifications for this to work:

function TppReport.AutoSearchCriteriaByName(..): TppAutoSearchField;
(...)
begin
(...)
lAutoSearchField := AutoSearchFields[liIndex];

// if (CompareText(aDataPipelineName,
lAutoSearchField.DataPipelineName) = 0) or
// (CompareText(aFieldName, lAutoSearchField.FieldName) = 0) then

if (CompareText(aDataPipelineName, lAutoSearchField.DataPipelineName)
= 0) AND { Modified }
(CompareText(aFieldName, lAutoSearchField.FieldName) = 0) then
(...)
end; {procedure, AutoSearchCriteriaByName}


procedure TdaQueryDataView.CreateAutoSearchFields(...);
(...)
begin
(...)
if (lCriteria.IsExpression) then
lField.FieldAlias := lCriteria.Expression
else
lField.FieldAlias := lCriteria.Field.Alias;

lField.DataPipelineName := Self.Datapipelines[0].UserName;
Added }
lField.FieldName := lCriteria.Field.FieldName;
(...)
end; {procedure, CreateAutoSearchFields}

Any feedback on correctly implementing these changes would be greatly
appreciated.

--
Best regards,

Arturo Monge
BitSoft Development
http://www.bitsoft.com

Comments

This discussion has been closed.