Sort as number, not as text
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Sort as number, not as text
I have a report where I want a databand to be sorted by a number-column.
The datasource in the stimulreport is generated from an xml-schema, to which a xml-file is bound duringruntime.
The valuetype of the number in the xml-schema is assigned as
But when I run it, the numbers come out in orders like:
1
10
17
2
24
3
35
instead of
1
2
3
10
17
24
35
How should I solve this?
The datasource in the stimulreport is generated from an xml-schema, to which a xml-file is bound duringruntime.
The valuetype of the number in the xml-schema is assigned as
But when I run it, the numbers come out in orders like:
1
10
17
2
24
3
35
instead of
1
2
3
10
17
24
35
How should I solve this?
Sort as number, not as text
Please check the type of the Column in the Designer. Please change type with right-click on the appropriate column and choose Edit from the context menu.
When it is not possible to change the type of the Column, please do the trick: Sorting via GroupBand. Place a GroupBand before DataBand and in Condition of the Group type something Like this:
{int.Parse(MyDataSource.MyColumn.ToString())}
Thank you.
When it is not possible to change the type of the Column, please do the trick: Sorting via GroupBand. Place a GroupBand before DataBand and in Condition of the Group type something Like this:
{int.Parse(MyDataSource.MyColumn.ToString())}
Thank you.
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Sort as number, not as text
I have checked the column in the designer, and it is set as "byte".
Tried to put the code you posted in a new groupheader below my existing one, but that just messed the report up.
Tried to put the code you posted in a new groupheader below my existing one, but that just messed the report up.
Sort as number, not as text
Maybe setting the sort option to this could help:
MyColumn.ToString().PadLeft(10,'0')
Hope that helps,
Marco
MyColumn.ToString().PadLeft(10,'0')
Hope that helps,
Marco
-
- Posts: 23
- Joined: Wed May 30, 2007 4:15 am
Sort as number, not as text
Hmm.........I cant find where I set the sortoption with code.....
Sort as number, not as text
If that does not work add a caluculated column with PadLeft.. and set the data to be sorted by this new column.
Marco
Marco
Sort as number, not as text
Please send your report to support [at] stimulsoft [dot] com.
Thank you.
Thank you.