Print Page | Close Window

CXTPReportRecordItemDateTime locale

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=11972
Printed Date: 17 November 2024 at 7:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportRecordItemDateTime locale
Posted By: znakeeye
Subject: CXTPReportRecordItemDateTime locale
Date Posted: 26 August 2008 at 8:46am
XTP 12.0.1.
When I create a CXTPReportRecordItemDateTime I expect its format to be the same as the result from COleDateTime::Format(void). Instead a strange formatting string is being used. Why?!



Replies:
Posted By: mgampi
Date Posted: 26 August 2008 at 9:08am
Hi;
I hit the same just a few minutes ago. Must have something to do with CXTPReportControlLocale. But I can't figure out how to configure it to use the same as COleDateTime.Format().

So I decided to write my own DateTime item class:
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();
}

void CXRReportRecordItemDateTime::SetValue(const COleDateTime& dtDateTime)
{
    m_odtValue=dtDateTime;
}

Perhaps Oleg can show us how to adjust the CXTPReportControlLocale to get the same behaviour...

-------------
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: znakeeye
Date Posted: 26 August 2008 at 2:42pm
I've found most of the item-classes to be inadequate, so I tend to write my own no matter what :)



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