Problem with CXTPReportRecordItemDateTime |
Post Reply |
Author | |
unknow
Groupie Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
Post Options
Thanks(0)
Posted: 15 November 2009 at 1:03pm |
Hi. I have a big issue with CXTPReportRecordItemDateTime class;
- I am using this class to display the hour within the ReportControl and sort by time range (60,90,120,>120 minutes)
- The problem occurs when I group the column headers with the field corresponding to this item
- the ReportControls reflect the changes and create groups according to the times comparison routine
- IF there is more than 2 groups, when I click an item, or give the focus to another application, the software goes mad, loops indefinitely and loads hundreds of megabytes in memory
- If there is only 1 group (example items with the same time value), the problem doesn't occur.
I think the problem comes from the sorting / priority order used by the ReportControl because if the GetGroupCaptionID function just returns -1, I obtain a group for each different value, but... it works!
I've tried everything like using SetGroupPriority, SetSortPriority etc... but nothing seems to work..
I'm using the exact same class to group by DATE and it works, so I really don't understand what is wrong !?
Here's the class, PLEASE any help is greatly appreciated ! I'm thinking about opening a case, but I guess I'm just forgetting to set something !?
class CMessageRecordItemTime : public CXTPReportRecordItemDateTime
{ DECLARE_SERIAL(CMessageRecordItemTime) public: CMessageRecordItemTime(COleDateTime odtValue = COleDateTime::GetCurrentTime()); virtual int GetGroupCaptionID(CXTPReportColumn* pColumn);
}; CMessageRecordItemTime::CMessageRecordItemTime(COleDateTime odtValue)
: CXTPReportRecordItemDateTime(odtValue) { SetFormatString("%H:%M:%S"); } int CMessageRecordItemTime::GetGroupCaptionID(CXTPReportColumn* /*pColumn*/)
{ if (m_odtValue.GetStatus() != COleDateTime::valid) return IDS_TXTNONE; int nLen = (m_odtValue.GetHour()*60) + m_odtValue.GetMinute(); if (nLen > 120)
return IDS_GROUP_TIME_XXXMIN; if (nLen > 90)
return IDS_GROUP_TIME_90MIN; return IDS_GROUP_TIME_60MIN;
} IDS Values are:
IDS_GROUP_TIME_60MIN = 2003
IDS_GROUP_TIME_90MIN = 2002
IDS_GROUP_TIME_120MIN = 2001 IDS_GROUP_TIME_XXXMIN = 2000 |
|
unknow
Groupie Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
Post Options
Thanks(0)
|
Just spend a few hours trying to find the problem, creating new classes etc... without success, until I found that...
What makes the reportcontrol goes mad is to group by such a string (loaded with ID from resources) : "Time: > 90 and < 120 minutes"
Why is that ??
|
|
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 |