![]() |
How to change DateTime item's format? |
Post Reply ![]() |
Author | |
d324 ![]() Groupie ![]() Joined: 16 April 2007 Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() Posted: 24 June 2007 at 10:49am |
Hi,
I'm using CXTPReportRecordItemDateTime in a report control to show a date for each record. The default shows something like "Fri Jun/22/2007 12:45 PM". Is there anyway to change the format? Thanks. |
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
Hi;
I derived from CXTPReportRecordItemDateTime and did it like this:
CXRReportRecordItemDateTime::CXRReportRecordItemDateTime(const COleDateTime& dt) : CXTPReportRecordItemDateTime(dt) {
SetFormatString(_T("")); } CString CXRReportRecordItemDateTime::GetCaption(CXTPReportColumn* /*pColumn*/) {
if (!m_strCaption.IsEmpty())
return m_strCaption;
if (m_odtValue.GetStatus()==COleDateTime::invalid) return _T(""); else return m_odtValue.Format();} |
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
You can do it easier: SetFormatString actually set the format string according to rules of COleDateTime::Format method.
-- WBR, Serge |
|
![]() |
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 |