Home End User

reporting autosearch criteria on the report

edited December 2009 in End User
?In our app, based on the report explorer, in the header of most reports,
there is a memo, and in that memo are placed the non-default criteria
selected by the user. I've searched in vain for the mechanics behind this,
in reports where it works now, and have only approximated it with a system
variable on the form containing SearchDesc, but that doesn't appear to
support downward growth of the object, among other issues.

Can you point me in the right direction, either in doc, or wiki, or a demo
app?

Thanks!



--- posted by geoForum on http://www.newswhat.com

Comments

  • edited December 2009
    Hi Bill,

    The System Variable simply assigns the TppReport.AutoSearchDescription
    property to the text value. If you would like to accomplish the same thing
    with a memo, you could access the same property.

    See the TppSystemVariable.GetStandardValue inside the ppVar.pas file for how
    this component functions.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2009
    ?Thanks, Nico!

    In reports where this has been added before I came into it, I see that if
    I delete the memo, and try to preview, it throws an error. Also, if I put
    such a memo in a report which has not had it, the connection is not made,
    so it is not populated. Those two facts seem to suggest that the report
    design itself contains a property somewhere which hooks up the memo for
    this functionality.

    Your reply seems to suggest I need to do something in code, but I'm not
    aware of code in the app being specific to the individual reports....



    --- posted by geoForum on http://www.newswhat.com
  • edited December 2009
    ?Also, on the reports where the criteria are displayed, I see no system
    variable of the vtSearchDesc type.



    --- posted by geoForum on http://www.newswhat.com
  • edited December 2009

    The only functionality in ReportBuilder that can automatically display the
    search criteria on the report is the SystemVariable. Otherwise you need to
    write some code.

    Both of your comments indicate that the report contains either Delphi code
    or RAP code that loads the Memo with the search criteria. Another
    possibility is that you or someone else created a custom memo descendant
    component.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2009
    ?Thanks, Nard, that gave me the clue I needed. now I have part of the
    solution in hand, but a problem remains.

    In the Modules view, in the Event Handlers section, how do I bring a new
    handler into existence? I right click in the list, and I see New in the
    menu, but it's commented out. Is there a module I must register to get
    this functionality?



    --- posted by geoForum on http://www.newswhat.com
  • edited December 2009
    wrote in message news:4b2801e5$1@mail....

    Not sure if I missed something here but we use a standard Memo component
    (not a DBMemo) in the footer and in RAP code for the Memo.OnPrint event just
    add:

    Report.GetAutoSearchDescriptionLines(Memo1.Lines);

    This populates the memo with text like this e.g.

    "Show all data where the Surname begins with S and the Area is equal to 31"

    This changes depending on the actual criteria entered at report run time.

    Regards, Paul.
  • edited December 2009
    ?Forget my last message, I got things sorted out.

    Thanks again!



    --- posted by geoForum on http://www.newswhat.com
This discussion has been closed.