Progress Column Sort |
Post Reply |
Author | |
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
Posted: 07 May 2012 at 5:09pm |
added progress column in CXTPReportControl but not sorted correctly?
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
What's you XAML/Markup for the progress bar? Can you make a small sample that I can experiment with?
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
ok thanks, not using XAML (maybe this is the problem?) just using the CXTPReportRecordItemProgress class as defined in the ReportCustomDraw sample CXTPReportRecordItemProgress* pRIP; |
|
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
ReportCustomDraw sample appears to sort ok so I'm obvioulsy missing something?
|
|
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
project uploaded ... uploads/6562/ReportTest.zip
|
|
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
probably doing something silly but something weird is happening ...
if I use 9,8,7,6 then sort order is 9,8 & 7,6 + 8,9 & 6,7 (which is ok) if I use 100,75,50,5 then sort order is 75,100 & 50,5 + 100,75 & 5,50 |
|
DazMan
Newbie Joined: 30 March 2009 Location: UK Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Think you will find the column is being sorted alphabetically, there are two possible solutions
Quick and dirty...
Change the format specifier of the caption, to include preceding spaces, as per the following line:
cstr.Format(_T("%3d%%"), progress, 0);
Or the more elegant...
Override the virutal Compare function definined in the base class of your CXTPReportRecordItemProgress class to sort the rows based on the m_nProgressPos member variable, causing the compare to be made numerically. Code would look something like this:
int CXTPReportRecordItemProgress::Compare(CXTPReportColumn*, CXTPReportRecordItem* pItem)
{ CXTPReportRecordItemProgress* pItemProgress = DYNAMIC_DOWNCAST(CXTPReportRecordItemProgress, pItem); if (!pItemProgress) return 0; if (m_nProgressPos == pItemProgress->m_nProgressPos)
return 0; if (m_nProgressPos > pItemProgress->m_nProgressPos) return 1; return -1; } |
|
dalai
Groupie Joined: 07 January 2011 Status: Offline Points: 36 |
Post Options
Thanks(0)
|
thanks. cstr.Format(_T("%3d%%"), progress, 0); fixed it.
|
|
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 |