I would like to be able to sort strings logically with the numeric portions of the string sorted the way a user would expect, and like Windows sorts filenames. For example, instead of a straight string sort in this order:
String 1
String 10
String 2
String 3
String 4
String 5
String 6
String 7
String 8
String 9
I would like to be able to to have them sort as:
String 1
String 2
String 3
String 4
String 5
String 6
String 7
String 8
String 9
String 10
Is this possible to sort strings like this in group and data bands?
Thank you very much.
Logical String Sort
Re: Logical String Sort
Hello.
Unfortunately, there is no such sorting.
You could add your own function that will return necessary result.
Thank you.
Unfortunately, there is no such sorting.
You could add your own function that will return necessary result.
Thank you.
Re: Logical String Sort
I can easily write a function to perform this comparison, but how can I set the group and data bands to use that sort function instead of the built-in sorting behavior?
Re: Logical String Sort
Hello.
You could create the function that will return value. For example, it could be strings like "01", "02", "10", "03" and etc. or numbers 1, 2, 10, 3 and etc. These data will be sorted by our engine as you need.
Thank you.
You could create the function that will return value. For example, it could be strings like "01", "02", "10", "03" and etc. or numbers 1, 2, 10, 3 and etc. These data will be sorted by our engine as you need.
Thank you.
Re: Logical String Sort
That won't work for me. The examples I posted are extremely simplistic, the actual data will not have consistent prefixes that I can just strip off to get the numeric value. The actual strings will have numbers and letters with no pre-set pattern. A better example data set would be:
a1
a5
a10
another 5
another 20
another string
b99
b100
Where the non-numeric portion is sorted by a straight string sort, then the following digits are sorted with a numeric sort. I essentially want to replicate the sort behavior that Windows provides for files with mixed numeric and alphabetic characters.
I am retrieving the report data from a database and calling StiReport.RegData to register the data set. If there are no options to accomplish this in Stimulsoft, do you know of a way to handle it on the c# level, possibly with a custom data column type or something like that?
Thank you very much.
a1
a5
a10
another 5
another 20
another string
b99
b100
Where the non-numeric portion is sorted by a straight string sort, then the following digits are sorted with a numeric sort. I essentially want to replicate the sort behavior that Windows provides for files with mixed numeric and alphabetic characters.
I am retrieving the report data from a database and calling StiReport.RegData to register the data set. If there are no options to accomplish this in Stimulsoft, do you know of a way to handle it on the c# level, possibly with a custom data column type or something like that?
Thank you very much.
Re: Logical String Sort
Hello.
Unfortunately, we have no such function for you.
Thank you.
We have already suggested you to write your own function in report template for sorting in C# and us it in group condition and sort expression.FS-Adrian wrote:I am retrieving the report data from a database and calling StiReport.RegData to register the data set. If there are no options to accomplish this in Stimulsoft, do you know of a way to handle it on the c# level, possibly with a custom data column type or something like that?
Unfortunately, we have no such function for you.
Thank you.