StrToInt
Hi,
I have a field on a table by which I want to sort.
Its a string field.
However it's a list of numbers.
So on the report its sorted like this
1,10,11,100,2,20,3,4,40,5,etc.
How do I use the StrToInt command (or another command or tool) to make it
sort like a list of numbers?
Thanks
Redmond
I have a field on a table by which I want to sort.
Its a string field.
However it's a list of numbers.
So on the report its sorted like this
1,10,11,100,2,20,3,4,40,5,etc.
How do I use the StrToInt command (or another command or tool) to make it
sort like a list of numbers?
Thanks
Redmond
This discussion has been closed.
Comments
ReportBuilder does not do any sorting on its own. All sorting is done
either in the dataset query or in an in-memory object such as a TStringList.
In order to sort this string field as you need, you may need to first move
the data to another dataset such as an in-memory dataset or perhaps creating
a sorting field A-Z.. etc. that sorts the string list that way. You could
also copy all the strings into a TStringList, sort those, then using a
JITPipeline add them to the report.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
If it is your table you could add afield of number type and fill it with
the integer representation of the string-field.
Otherwise you could use a TClientDataset and add a InternalCalc-field and
fill it with the integer representation of the string-field in OnAfterOpen
for each record.
--
Best regards
Dietmar Brueckmann