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

Where does RB Validate AutoSearch values?

edited May 2003 in DADE
Let me describe briefly what I ams trying to do: I want the enduser on the
data tab to be able to enter the words "StartDate" and "StopDate" into the
Value box when setting the search on a report. I want to know in what unit
RB checks whether something is a valid date or not. I also want to put
"StartDate" and "StopDate" back into the Value when the report is done.
There are several reports that might have multiple searches on dates in
different dataview, I want them to be able to Choose the dates just once for
the report & apply to all AS-criteria where StartDate or stopdate is the
value, or have option to enter regular date to bring another date AS-panel
up. I'd also need to change my Dataset.GetFieldsForSQL to ignore any sql
line w/stopdate or startdate on it. In what unit/procedure does RB check for
the valid date. How could I override it or modify it?

-Thanks
Dan Armstrong

Comments

  • edited May 2003
    RB validates the search values when you close the autosearch dialog based on
    type. Then the autosearch fields values are added to the WHERE clause and
    then the SQL is submitted to the server.

    Instead of modifying the source, what you should do instead is create a
    custom autosearch panel to handle the dates. See the custom autosearch
    dialog example in the RBuilder demos for an example.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    Let me clarify. I already have a custom autosearch dialog. I'm asking
    about where the dayes are validated in the End-user RAP in the dataviewQuery
    designer wizard. I want the person that is building the report to be able
    to put "Startdate" and/or "Stopdate" in the AS-value. Should I be making my
    own custom dataviewQuery designer wizard? Any
    Examples of that?

    -Dan
  • edited May 2003
    If you want to do this inside DADE, then you could create a custom dataview
    template for them. There are examples of this which also use autosearch on a
    custom dataview template in our End User demos directory, maybe that would
    be easier for you users to use?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    That demo is really slick. I'll use that. But in this case that would
    limit flexibility. The function I want to override is in
    ppUtils.StrtoDateTime. How can I overide just that function? I'm going to
    have it change Stopdate to :Stopdate -I have a function in my custom DADE
    that check for params in OnBeforeOpen of my Qury components & does the
    appropriate stuff. I'm fairly new to programming, so can you give me an
    idea of how I can overide that one function for this project? Do I copy
    ppUtils, empty all the other procs/funcs of code -replace with 'inherited;'
    then include StrtoDateTime with modified code & put a register, unregister
    thing in the implementatio/finalization? then put in my uses clause of my
    report's form?

  • edited May 2003
    Unfortunately, unlike most of RB, ppUtils is not object oriented. It is a
    collection of functions modeled after Delphi's "SysUtils style of
    programming" years ago. If you want to change the way a function is
    implemented, you will have to change it in ppUtils in Rbuilder\Source. Then
    change your Delphi Environment Settings | Library Path from RBuilder\Lib to
    RBuilder\Source. Search our source for uses of ppUtils.StrToDateTime and
    make sure you don't break other RB code. Most likely, this change will break
    the other places in RB that use it. A better way to do it is to create a new
    function to call instead in our source where you want to change it in stead
    of replacing the ppUtils.StrToDateTime internal implementation.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.