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

Autosearch Descriptions

edited March 2002 in General
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.

Comments

  • edited March 2002
    Instead of using Report.GetAutoSearchDescriptionLines, you could write your
    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

This discussion has been closed.