Autosearch Descriptions
I have written my own Custom AutoSearch Dialogs.
TheAutoSearchField.SearchExpression field is the value that gets passed
to the SQL query as well as the value that is returned when the
GetAutoSearchDescriptionLines is fired in the report. Is there a way to
change the AutoSearchFields[].Description value to something more
meaningful which will print in the report? Now I have a record ID value
being passed to the query as well as being shown on the report.
TheAutoSearchField.SearchExpression field is the value that gets passed
to the SQL query as well as the value that is returned when the
GetAutoSearchDescriptionLines is fired in the report. Is there a way to
change the AutoSearchFields[].Description value to something more
meaningful which will print in the report? Now I have a record ID value
being passed to the query as well as being shown on the report.
This discussion has been closed.
Comments
own procedure. It would need to loop through the autosearch fields in the
report by using the Report.AutoSearchFieldByName and create the description
for each field.
procedure ...
var
lSearchField: TppAutoSearchField;
begin
lSearchField := ppReport1.AutoSearchFieldByName('Customer');
...
You can model your code after ours, to build the indivisual descriptions:
@{@TppAutoSearchField.Description
Returns a full description of the search condition contained in the
AutoSearchField. How the description begins depends upon the value of the
FirstField property. A typical description: 'Show all data where the
company
name begins with 'T%'. For an example of how to use the description, see
the
demo in the...RBuilder\Demos\AutoSearch\6. Build Description of AutoSearch
directory.}
function TppAutoSearchField.Description: String;
begin
if (FirstField) then
Result := ppLoadStr(54) {Show all data where the}
else
Result := ppLoadStr(55); {and the}
if (ShowAllValues) then
Result := Result + ' ' + FieldAlias + ' ' + ppLoadStr(1036) {'has any
value'}
else
Result := Result + ' ' + FieldAlias + ' ' + OperatorDesc + ' ' +
SearchExpression;
end; {function, Description}
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com