European decimal separator (",") and AutoSearch parameters
Hi,
my company is developing an application which embeds an "End-User" approach
in order to let our customer edit thir own reports through RBuilder
(including the defintion of the datasets and search filters).
Our environment is:
- Delphi 2010 Enterprise
- RBuilder 11.07 Enterprise
- SQL Server 2005
Our customers reside all over the world (USA, Europe, Asia, ...) and we are
experiencing several problems with the localization of the reporting
solution.
Most of them involve the AutoSearch parameters defined dinamically in the
reports, when teir datatype is Date, Time, DateTime or Float, Currency.
Date and time values seem to be wrongly converted in the SearchExpression
when building the "MagicSQL" if the the ShortDateFormat and/or
ShortTimeFormat global variables are not in a simple format (e.g.
"dd/MMM/yyyy"). We currently worked aroud this problem forcing the
application FormatSettings to a "only numeric" kind, but I must say that
this is not a real solution, because we may deal with clients not accepting
this behaviour.
But we are still struggling with the float and currency AutoSearch
parameters when the local DecimalSeparator is set to ',' (comma) which is
widely used in Europe. This problem arises also using BDESession for the
SessionType.
Here the step to reproduce the problem:
1) Set system locales decimal separator to ',' (comma) and thousand
separator to '.' (dot)
2) Open a new VCL-Form application with a single Form
3) Place on the form a TDatabase, set:
- AliasName = "DBDEMOS"
- DatabaseName = "TestDatabase"
4) Place a TppDesigner, set:
- DataSettings.DatabaseName = "TestDatabase"
- DataSettings.DatabaseType = "dtParadox"
- DataSettings.SesionType = "BDESession"
Report = the TppReport of point 5)
5) Place a TppReport
6) At design-time (double-click on the TppReport) creat a simple
datapipe through the Query-wizard, reading all the data from table 'orders'
(let its name be 'orders').
7) In the Query designer go to the "Search" tab and double-click on
AmountPaid field alias, then:
- enable the Autoserach flag for the parameter
- let its Operator be ">" (greather than)
- set '0' (zero) as its value
- click OK
8) go on the Preview tab, and click the "Search data" button (the lens),
the Autosearch dialog is displayed asking for the value for "AmountPaid"
field
9) enter "1000,5" (or what ever floating point value): note that the
COMMA is the decimal separator
10) clicking OK I get an "Invalid use of keyword. Token: )" error.
Sorry for being so verbose...
Is there something I am missing? Do I use properly your components?
I tried to debug RBUilder sources and found some troubles when the
SearchExpression of the AutoSearch criteria is read-written (when values are
passed through the CommaText property of a TStrings) when building the
"MagicSQL".
Please give me good news about this.
Regards
Ettore
P.S. I could provide sources of testing application, if needed
my company is developing an application which embeds an "End-User" approach
in order to let our customer edit thir own reports through RBuilder
(including the defintion of the datasets and search filters).
Our environment is:
- Delphi 2010 Enterprise
- RBuilder 11.07 Enterprise
- SQL Server 2005
Our customers reside all over the world (USA, Europe, Asia, ...) and we are
experiencing several problems with the localization of the reporting
solution.
Most of them involve the AutoSearch parameters defined dinamically in the
reports, when teir datatype is Date, Time, DateTime or Float, Currency.
Date and time values seem to be wrongly converted in the SearchExpression
when building the "MagicSQL" if the the ShortDateFormat and/or
ShortTimeFormat global variables are not in a simple format (e.g.
"dd/MMM/yyyy"). We currently worked aroud this problem forcing the
application FormatSettings to a "only numeric" kind, but I must say that
this is not a real solution, because we may deal with clients not accepting
this behaviour.
But we are still struggling with the float and currency AutoSearch
parameters when the local DecimalSeparator is set to ',' (comma) which is
widely used in Europe. This problem arises also using BDESession for the
SessionType.
Here the step to reproduce the problem:
1) Set system locales decimal separator to ',' (comma) and thousand
separator to '.' (dot)
2) Open a new VCL-Form application with a single Form
3) Place on the form a TDatabase, set:
- AliasName = "DBDEMOS"
- DatabaseName = "TestDatabase"
4) Place a TppDesigner, set:
- DataSettings.DatabaseName = "TestDatabase"
- DataSettings.DatabaseType = "dtParadox"
- DataSettings.SesionType = "BDESession"
Report = the TppReport of point 5)
5) Place a TppReport
6) At design-time (double-click on the TppReport) creat a simple
datapipe through the Query-wizard, reading all the data from table 'orders'
(let its name be 'orders').
7) In the Query designer go to the "Search" tab and double-click on
AmountPaid field alias, then:
- enable the Autoserach flag for the parameter
- let its Operator be ">" (greather than)
- set '0' (zero) as its value
- click OK
8) go on the Preview tab, and click the "Search data" button (the lens),
the Autosearch dialog is displayed asking for the value for "AmountPaid"
field
9) enter "1000,5" (or what ever floating point value): note that the
COMMA is the decimal separator
10) clicking OK I get an "Invalid use of keyword. Token: )" error.
Sorry for being so verbose...
Is there something I am missing? Do I use properly your components?
I tried to debug RBUilder sources and found some troubles when the
SearchExpression of the AutoSearch criteria is read-written (when values are
passed through the CommaText property of a TStrings) when building the
"MagicSQL".
Please give me good news about this.
Regards
Ettore
P.S. I could provide sources of testing application, if needed
This discussion has been closed.
Comments
emailing you the patch. Registered 11.07 users can email support@ and
request the patch.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
the patch has solved the problem of the floating point parameter with a
single value.
But (there is always a 'but') the error still occurs in two situations:
- at design time (and this is not an issue to me);
- when the Autosearch operator type is 'between' or 'in list'
(that is, when multiple values are allowed for the Autosearch field)
The second point is actually an issue, even if I consider it a 'non
blocking', since the 'between' could be substituted with two autosearch
fields ('>' and '<') settings.
We will need to document this problem to our customers, because they are
building their own queries and reports through the End-user designer.
I hope to find a complete solution in the next RBuilder release.
I just emailed you a patch to fix the multi-value (Between, InList) case.
And yes, a source code patch does not fix Delphi design-time. That requires
rebuilding the packages, which is something that we do not do for patches.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
the 'decimal separator' issue has been solved!
Regards
Ettore
P.S. I forgot that I need to rebuild also the packages...
Actually our application uses runtime packages, so I rebuilt
rbRCL1114.bpl
--
Ettore Bottega
OmniTicket Network S.r.l.
if regional settings are differrent from pc to pc; reports with a 'between'
clause show the error. If the user enter an integer followed by a ',' with
no decimals the report works ok.
do I need some patch to?