Print Page | Close Window

How to change DateTime item's format?

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=7436
Printed Date: 22 November 2024 at 8:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change DateTime item's format?
Posted By: d324
Subject: How to change DateTime item's format?
Date 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.



Replies:
Posted By: mgampi
Date Posted: 26 June 2007 at 10:39am
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


Posted By: sserge
Date Posted: 06 July 2007 at 4:39pm
You can do it easier: SetFormatString actually set the format string according to rules of COleDateTime::Format method.

--
WBR,
Serge



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