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

Serious issue with dates in autosearch fields

edited December 2001 in General
I have a serious problem regarding dates and autosearch fields. At design
time, I have to supply certain reports with a pre-defined date. Everything
is fine, as long the date-time format stays the same on each machine this
report is running on. Change the short-date-format to something else, and
the report breaks.

I understand the need to translate the string to a date-time value during
design, but why is the date stored as a String in the template and not as a
Double? In my opinion dates should only be converted to and from strings
when it comes to communicating with the user, but never for internal stored
data. It would be very much appreciated if this could be rectified with the
next update.

Cheers, Marco Heine...
-------------------------------------------------------------------
Marco Heine
QUMAS
Enterprise Compliance Management
Visit our Website: www.qumas.com

Comments

  • edited December 2001
    Thankyou, for the suggestion.

    You should be able to successfully load a template which was saved in
    another language, without any errors. Use the OnLoadEnd event of the
    template to extract the TdaCriteria object from the dataview's TdaSQL
    object. You can then change the criteria object's Value property for the
    language which will match the current regional settings on the machine.
    There is a TechTips on using template events in the tempaltes thread. There
    is also a tech tip on extracting the SQL object in the CodeBased thread.
    There is a Criteria array property on the TdaSQL object.

    The date is stored as a string because for the development of Autosearch,
    the alternative was that there would have to be a whole set of classes. One
    class for each of the datatypes that could be saved in the template for the
    autosearch criteria. At the time, it made sense to store them all as
    strings instead.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited December 2001
    Hi Jim,

    thanks for your suggestion of this work around. I will defiantly have a look
    at this.

    Though, I don't quite understand why you need different object types. All
    you would need to do is to add a type field (enumerator) to the object and
    use different convert to/from string options (i.e. IntToStr, etc.) and store
    dates as a converted double. The type of the autosearch field would be
    automatically determined by the database field.

    Cheers, Marco...
    -------------------------------------------------------------------
    Marco Heine
    QUMAS
    Enterprise Compliance Management
    Visit our Website: www.qumas.com

This discussion has been closed.