Home General

AutoSearch Field Text

edited July 2001 in General
Given the following;

procedure TForm1.Report1AutoSearchDialogClose(Sender: TObject);
var thevalue: variant;
begin
//for populating a memo field with query text
memo1.Clear;
Memo1.Lines.Text := Report1.AutoSearchDescription;
end;


Is it possible to turn off the creation of the text for any autosearch
fields that are bypassed, (user checks checkbox to accept all field
values)?

I obviously want to work on this text outside of the RB code to avoid
any changes being overwritten in upgrades...

Thanks for any advice you can give!!!

John

Comments

  • edited July 2001
    Instead of calling Report.AutoSearchDescription(Memo.Lines) write your own
    procedure:

    procedure TForm1.GetAutoSearchDescriptionLines(aLines: TStrings);
    var
    liIndex: Integer;
    begin

    aLines.Clear;

    for liIndex := 0 to ppReport1.AutoSearchFieldCount - 1 do
    begin
    if (aLines.Count = 0) then
    ppReport1.AutoSearchFields[liIndex].FirstField := True;

    if (String(ppReport1.AutoSearchFields[liIndex].Value) <> '') then
    aLines.Add(ppReport1.AutoSearchFields[liIndex].Description);

    end;

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2001
    Also, since it made sense, I stuck it in the Get for the property read so it
    should be in a future maintenance release.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2001
    Jim,

    Thanks ever-so-much!!!!

    Yes, it would be a nice little enhancement...to be able to turn on/off the query
    text according to what the user checks.

    Thanks again,

    John

This discussion has been closed.