Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [solved] Do not sort footer rows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Do not sort footer rows

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1059
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Do not sort footer rows
    Posted: 27 March 2018 at 3:10am
Hi;

I use several footer rows with merged cells at the beginning (column 0 to 7). I add the records in a distinct order to the footer records collection that never should change.
But as soon as the user sorts one of the columns that are part of the merged cells the order of the footer rows change too (see screenshot):



How can I avoid this unwanted change!
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1059
Post Options Post Options   Thanks (1) Thanks(1)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2018 at 3:33am
Hi;

I believe I found the error!
When CXTPReportControl::PopulateFooterRows() is called it is forwarded to CXTPReportSection::Populate(). Within this methode I see a SortRows() call that's not necessary when IsAllowSort() of the section returns FALSE!
Therefore, it's a bug inside the toolkit.

Please change this in the next release within CXTPReportSection::Populate():

...
if (IsVirtualMode())
    {
        ...
    }
    else
    {
        BuildTree(m_pTree, NULL, m_pRecords);
        m_nPopulatedRecordsCount = m_pTree->GetCount();

        if (IsAllowSort())    <-- This condition is missing here!
          SortRows(m_pTree);
        int nGroupRowsCount = 0;
...

Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1059
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2018 at 3:43am
But, perhaps it's better to return from CXTPReportSection::SortRows() as soon as CXTPreportSection::IsAllowSort() returns FALSE to catch other possibilities in toolkit code too!
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1059
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2018 at 12:16pm
Hello;

Can someone from CJ please confirm this bug?
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 18.5.0
Platform: Windows 8.1 (64bit)
Language: VC+
Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 836
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2018 at 6:57pm
Hello Martin,

Thanks for information about this issue. I think it is enough to change method CXTPReportSection::SortRows 
void CXTPReportSection::SortRows(CXTPReportRows *pRows)
{
    ASSERT(pRows);

    CXTPReportColumns *pColumns = m_pControl->m_pColumns;
    XTPReportRowsCompareFunc pRowsCompareFunc = m_pControl->m_pRowsCompareFunc;

    if (pRows == NULL || 0 == pRows->GetCount() || !IsAllowSort())
        return;

I will add these changes to next release.

Regards,
 Oleksandr Lebed
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.