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

Date search criteria...default to 'Now'

edited May 2003 in End User
Hi All,

In an end-user report...is there a way to have a datetime search criteria
put the current date in the search box when running the report and the user
selects the search dialog?

TIA,
Stacey

Comments

  • edited May 2003
    This can be done. However, there are some considerations. Are you creating
    search criteria on the dataviews in code? First, when you or your user
    create dataviews, they are persistent search criteria. When the form loads,
    these search criteria cause autosearch fields to be created on the report,
    which get used to apply the filtering on the where clause of the dataview's
    SQL generation. Here is an example the frees them and recreates the criteria
    with new values (Now) and forces new autosearch fields to be created.
    http://www.digital-metaphors.com/tips/UseNowDateForSearchCriteria.zip

    An easier way (one line of code) is to simply modify the autosearch field
    object and leave the criteria objects alone. Here is an example to compare:
    http://www.digital-metaphors.com/tips/UseNowDateForSearchCriteriaSimple.zip

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    i am looking for that, but only with teh methods of the enduser designer.
    In the examples, i have to know the creteria [0..n] in wich the user puts in
    a date selection.
    Is there not a better suport in the value field of the data-tab, so the user
    could enter now or now-1 or the first and last date of a month?
    chis

  • edited May 2003
    For your users, you can always create your own autoserach dialog. For
    example, we ship a demo that has a data time picker component in the
    autosearch dialog for a date range. You can default your custom autosearch
    dialog to show Now as a value if you would like to. See the autosearch demos
    in the RBuilder demos directory.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.