Sort the column to numeric values? |
Post Reply |
Author | |
g.novi
Groupie Joined: 27 October 2009 Location: Italy Status: Offline Points: 38 |
Post Options
Thanks(0)
Posted: 13 July 2011 at 7:27am |
How to sort the column to numeric values?
A report column contains numeric values but the sort does not work. Now sort in this way: 10,00 100,00 12,00 13,00 20,00 3,00 I would like this result: 3,00 10,00 12,00 13,00 20,00 100,00 Thank's to all |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Did add numeric values as text or as Integer, Long, Double? RC supports type sorting. If you added it as text it sorts like MS explorer does, 1,10,11,2,3,4,5 etc, etc
If you are able to convert text to type you need it will work, if you can't just set .SortPriority when adding items to RC
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
g.novi
Groupie Joined: 27 October 2009 Location: Italy Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Hi, maybe because I insert formatted numbers? (Ex: 12 in 12,00). How do I get formatted numbers and correct sort? Thank You. |
|
g.novi
Groupie Joined: 27 October 2009 Location: Italy Status: Offline Points: 38 |
Post Options
Thanks(0)
|
If I convert text into Double type it works, but the number will not be formatted! How can I do!? Thank's
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
OK, you solved that part... You can't use .Format property because it will be "converted" to a string and it doesn't sort properly anymore. Best way is to use custom format in BeforeDrawRow event something like this: in FormLoad (or wherever you initialize RC) set: Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
Row.Record.Item(0).Caption = Format(Row.Record.Item(0).Value, "##0.#0") End Sub |
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
g.novi
Groupie Joined: 27 October 2009 Location: Italy Status: Offline Points: 38 |
Post Options
Thanks(0)
|
Very well !!! Thank you |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |