[solved] Do not sort footer rows
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=23618
Printed Date: 24 April 2024 at 9:28am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: [solved] Do not sort footer rows
Posted By: mgampi
Subject: [solved] Do not sort footer rows
Date 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 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017
|
Replies:
Posted By: mgampi
Date 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 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017
|
Posted By: mgampi
Date 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 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017
|
Posted By: mgampi
Date Posted: 27 March 2018 at 12:16pm
Hello;
Can someone from CJ please confirm this bug?
------------- Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017
|
Posted By: olebed
Date 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
|
|