Home End User

Dsplay search criteria on report?

edited December 2002 in End User
Hi,

Someone asked previously how you might be able to display the user's chosen
criteria on a report. It was suggested that the
Report.GetAutosearchDescriptionLines would do the trick. However, if I am
right, this cannot be called from RAP? How can I simply display the results
of the criteria in the report header from the end-user facility? Is there a
sample report (rtm) that shows how to do this?

Thanks

Alex

Comments

  • edited December 2002
    Ok I have found GetAutoSearchDescriptionLines can be used somehow, it is a
    procedure with a parameter for aLines??? Can't find any samples or doco in
    the help files, so any examples of how to assign the contents of the search
    fields to a displayable calc field on the report would be very appreciated.

    Thanks

    Alex

  • edited December 2002
    Hi Alex,

    you have to pass a 'TStrings' object, usually a 'TStringList', the method fills the list with the criteria informations.
    To use it within RAP create a pass-through function.

    regards,
    Chris Ueberall;
  • edited December 2002
    Hi Chris,

    I have been through the pass-through examples. Can you give me an example
    of what the pass-through code for getting criteria into a stringlist would
    involve as I am moving a little out of my depth at the moment? I didn't
    realise being able to simply print the user selected criteria on a report
    would become this involved. Wouldn't it make sense to have such a function
    as standard functionality, being I would assume a very common requirement?

    Cheers

    Alex

  • edited December 2002
    Alex,

    it is simpler as I thought in my last answer. You don't need a pass-through function, because RAP RTTI is already implemented for that method. But there should be some information about that method in the help file, missing that.
    I used the following in the global 'OnCreate' event:

    Report.GetAutoSearchDescriptionLines(Memo1.Lines);
    which worked for me.

    regards,
    Chris Ueberall;
  • edited June 2003
    Hi!
    Can anyone tell me how to implement that on user side.
    Let's say that user has created one report with custom search criteria. How
    can he see that criteria in his report at once.
    Is there any example of that.
    Sorry, for posting maybe double thread...
    Damir
  • edited June 2003
    What I want to say is that I have found demo "$Delphi7$\RBuilder\Demos\5.
    AutoSearch\7. Create EndUser AutoSearch Fields" but have question how to
    localize that expression to other language (not supported by RBuilder) or to
    see the source so I can override that "GetAutoSearchDescriptionLines"
    function to display other language....
    THX!

  • edited June 2003
    The report has a method GetAutosearchDescriptionLines. It should be
    translated. Make sure you change the Report.Language property and see the
    RBuilder\Languages\ReadMe.doc for deployment info.

    This is used to get the description for an autsoearch field:

    From the help file:

    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.