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

AutoSearchDescription

edited March 2003 in End User
Hello all,
I am an end user, trying to display the values entered in the AutoSearch
dialog. I am using Memo1.lines.text:= Report.AutoSearchDescription
and
Report.GetAutoSearchDescriptionLines(Memo1.lines);

This returns the the promt and the data entered. Is thera a way to just
return the data entered?

Chris Lawery

Comments

  • edited March 2003
    Yes, loop through the Report.AutosearchFields[] array and pull out the
    values directly of the autosearch field objects. Look at our source for
    example of how to do this:

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

    aLines.Clear;

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

    {ignore those fields where no criteria was entered by user in AS
    Dialog}
    if (String(AutoSearchFields[liIndex].Value) <> '') then
    aLines.Add(AutoSearchFields[liIndex].Description);

    end;

    end; {procedure, GetAutoSearchDescriptionLines}



    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Jim,
    Thanks for the reply. I have little to no Delphi experience so please
    bare with me. The following is what I entered in Report Builder:

    procedure ReportAfterAutoSearchDialogCreate;
    var
    aLines: TStrings;
    liIndex: Integer;
    begin
    aLines.Clear;
    for liIndex := 0 to Report.AutoSearchFieldCount - 1 do
    begin
    if (aLines.Count = 0) then
    Report.AutoSearchFields[liIndex].FirstField := True;

    if (String(Report.AutoSearchFields[liIndex].Value) <> '') then
    aLines.Add(Report.AutoSearchFields[liIndex].Description);
    end;
    variable3.value := Report.AutosearchFields[liIndex]

    end;

    I receive the following errors when I try to compile in Report Builder:
    Error: ReportAfterSearchDialogCreate, Line 10: Expected: '(' or '[', but
    found 'FirstField' instead
    Error: ReportAfterSearchDialogCreate, Line 13: Expected: '(' or '[', but
    found 'Description' instead

    Any further assistence would be greatly appreciated.
    Thanks in advance,

    Chris Lawery

  • edited March 2003
    Sorry, I missed the part where you said you were a end user. Our support
    policy is to only support our customers (the Delphi developers) and not
    their end users. Please understand that you should contact your application
    vendor for support.


    Use the Memo.OnPrint event to do this.

    Try deleting the lines I commented below.

    Then try using Value instead of Description as I changed below.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    I was trying to paste and I accidentally sent the message too soon, but I'd
    like to add this option for you:

    Contact your vendor and have them code a RAP pass through function to do
    this more easily so you only have to code one line of code to populate the
    memo with the autosearch values only and not the full descriptions.

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.