Auto-Search Date Formatting
RB7/D6/daAsta/SQLA5
Using an End User app a report has an auto-search date field. The
user who created it has regional short date settings of yyyy-mm-dd and
another who runs it has yyyy/mm/dd.
The TdaCriteria stores it as yyyy-mm-dd but when the second user tries
to preview they don't get the stored value they get the current
datetime (I believe because the ppStrToDateTime is throwing an
EConvertError).
Is there something I need to set to accommodate varying workstation
regional settings?
Thanks,
Rick Matthews
Dartek Systems Inc.
Using an End User app a report has an auto-search date field. The
user who created it has regional short date settings of yyyy-mm-dd and
another who runs it has yyyy/mm/dd.
The TdaCriteria stores it as yyyy-mm-dd but when the second user tries
to preview they don't get the stored value they get the current
datetime (I believe because the ppStrToDateTime is throwing an
EConvertError).
Is there something I need to set to accommodate varying workstation
regional settings?
Thanks,
Rick Matthews
Dartek Systems Inc.
This discussion has been closed.
Comments
string, since it saves it using the regional settings of the machine that it
was created on. There is no ability in RB to convert between local
settings. This will be an enhancement to allow you to load the search
criteria no matter what the regional settings are for the format of any date
search criteria saved in a report.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Would this enhancement be in a point release for rb7? Could you
estimate when it might be available (1 month, 3 months etc.)? I have
to decide if I can wait for it in the product. If I need it earlier
could you indicate the modules/methods I should update myself?
Thanks,
as a double for date time formats, but that won't work as a quick fix
because there are other types of criteria that the value could be. The
criteria value is a string because the criteria value is saved down as a
string even for the other criteria values. For example, save down a report
template to ascii format which has a dataview with search criteria on a
numeric field. You'll see that it saves the criteria object's Value property
down in string format. The problem is that everything is saved down in
string format and then converted when it is time to use the search criteria.
There isn't a quick fix, as there are conversion issues to be addressed for
the current templates that are in use right now. We can't really give a
valid estimate for when this might get enhanced. There are other
enhancements we need to make in RB as well. It depends on how long those
take as we work our way through the queue of features to add.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Cheers,
I looked a bit more carefully and in the saved template the double is
being saved - although the value property is the string date.
I got a little lost in following the loading procedure but I think the
numericvalues are re-created from the value property on load and then
the value is updated from the new numerics (TdaCriteria.Loaded)? Is
there any way in TdaCriteria.Loaded to get the TdaNumericValue objects
and use them directly to set FValue - or do I need a parallel property
FNValue which could be a comma separated string of double values?
For instance in a sample template I have:
object daCriteria3: TdaCriteria
ChildType = 7
Level = 0
Operator = dacoBetween
Value = '1800/12/30,1899/12/31'
object TdaField
Alias = 'TDate'
AutoSearch = True
DataType = dtDateTime
DisplayWidth = 10
FieldAlias = 'TDate'
FieldLength = 10
FieldName = 'TDate'
SQLFieldName = 'TDate'
TableAlias = 'Test)'
TableName = 'Test'
TableSQLAlias = 'Test'
end
object TdaNumericValue
Value = -36159
end
object TdaNumericValue
Value = 1
end
end
Thanks,
that down. We'll have to research this further to see why it is failing as
it should be able to take the numeric values and convert them using the
regional settings for the short date format.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com