Print Page | Close Window

Format thousands separator

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=14362
Printed Date: 15 November 2024 at 1:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Format thousands separator
Posted By: DavidSpain
Subject: Format thousands separator
Date Posted: 21 May 2009 at 12:57pm
Hello friends!

Regarding the formats of cell in the report grid,
We have seen that there are plenty of potential.
However, we do not know how to do that in the case
digital formats, separate the thousands:

For example:
1234  -->  1.234
100000  --> 100.000
5876154 --> 5.876.154

Is there any way through format property?

We can pass it as text, but then it does not order the data correctly.

Many thanks in advance.


Product: Xtreme SuitePro (ActiveX) version 13.0.0
     Platform: Windows XP (32bit) - SP 2
     Language: Visual Basic 6.0



Replies:
Posted By: Aaron
Date Posted: 22 May 2009 at 4:45am
Hi,
 
If you assign values (numbers) to ReportItems it will sort correctly (even without any format).
 
Set rec = wndReportControl.Records.Add()
        Set recItem = rec.AddItem(i) 'Sort OK
        
        Set recItem = rec.AddItem(i & " Kb") 'Sort not OK
        
        Set recItem = rec.AddItem(i) 'Sort OK
              recItem.Format = "%s Kb "
 
        Set recItem = rec.AddItem(FormatNumber(i / 3, 2))
              recItem.Format = "%s kb 'Sort not OK 
              recItem.SortPriority = i / 3 'Now it sorts OK
But you have to be carefull with SortPriority: Public Property SortPriority() As Integer
 
 


-------------
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....


Posted By: DavidSpain
Date Posted: 22 May 2009 at 5:46am
First step with the value formatted text and then pass the same numerical value to the property sortpriority.

It works!

Thank you, Aaron!



Posted By: mdoubson
Date Posted: 23 May 2009 at 8:32pm
Did somebody tried to use formated values in PropertyGrid? Regional settings can use decimal point or comma also use comma as thousand saparators and so on. Same question about currency values.
 
btw - each ReportRecordItem have Format property so you can keep value as common sense sortable and present it in the item caption after format applied
 
We can also add Column-based format which can be apply for any item of  thic column (easy assing in the code).  
Next step - use internal UnitManager which can convert on-fly any unitized value from permanent unit to dynamic presentation unit so app can run in different countries and connected to same common database
We also need to think about more rich set of column (item) types (e.g. support images or other blob data)


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net