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

Determining User Selection

edited June 2006 in End User
I have a report that prompts the user for a begin and end date and then runs
a query on the database based on those parameters.

However, I want to print those parameters on the report itself so that when
it prints they know what selected range was printed. But I can't figure out
how to get to what they selected in their query. Can anyone help me?

Thanks,

Comments

  • edited June 2006

    Report.AutoSearchDescription will return a description of what was entered
    or you can use TppReport.GetAutoSearchDescriptionLines to get it a
    TStringList.

    For an example check out RBuilder\Demos\5. AutoSearch\5. Build Description
    of AutoSearch Settings





    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2006
    Thanks, that seems to be what I'm looking for, however, I'm trying to
    figure out how an end-user is going to utilize this in order to show their
    parameters since you don't have full access to coding functions with the
    end-user module...



  • edited June 2006
    I am reviewing the demo but when I type the following line in the end user
    Calc tab I get ppreport1 undeclared identifier despite that being the
    reports name... I'm adding the code into the
    report/beforeautosearchdialogcreate method just like in the demo you pointed
    to. What am I doing wrong?

    Thanks,



  • edited June 2006
    I used the first suggestion and get back a string of the where clause which
    is really not what I'm after. I want just the begin and end date that was
    entered which it appears the second suggestion would give me. However,
    after trying 5 different ways of getting that data it returns nothing. The
    last attempt was directly from the demo you pointed me to and consists of a
    line as follows:

    ppReport1.GetAutoSearchDescriptionLines(ppMemo1.Lines);

    where I created a memo field on the report just to see what would show up,
    and as with all my other attempts, nothing shows up.

    Any suggestions?

    thanks,



  • edited June 2006

    - Perhaps you are new to RAP? If so please work thru the RAP related
    tutorials in the RB Developers Guide and the Learning ReportBuilder RAP
    end-user guide.

    - To simply things for end-users, RAP does not use the Delphi Component Name
    property, but instead uses the UserName property . The UserName is the name
    displayed throughout the report designer. If you look at the report outline
    (in Design or in Calc) note that the outline displays something like

    Report
    |
    --- Memo1

    Here is an example, the Delphi code (uses the component Name)

    ppReport1.GetAutoSearchDescriptionLines(ppMemo1.Lines);

    And the same code in RAP (uses the component UserName)

    Report.GetAutoSearchDescriptionLines(Memo1.Lines);

    - If you want only the Values entered by the user rather than the
    description, then iterate over the Report.AutoSearchFields array and access
    the Report.AutoSearchFields[].SearchExpression property





    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.