<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Sorting in ReportControl</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Sorting in ReportControl]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 06:49:37 +0000</pubDate>
  <lastBuildDate>Wed, 13 May 2009 09:29:30 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=8741</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Sorting in ReportControl : Hi Zitz,  I just read your answer,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=48941&amp;title=sorting-in-reportcontrol#48941</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2347">Sergio</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 13 May 2009 at 9:29am<br /><br />Hi Zitz,<br /><br />I just read your answer, sorry for the long delay.<br /><br />Yes, I confirm that ReSortRows() works and fix the problem. (We did the same.)<br /><br />Thank you for your answer.<br /><br />Regards,]]>
   </description>
   <pubDate>Wed, 13 May 2009 09:29:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=48941&amp;title=sorting-in-reportcontrol#48941</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl : Hi, Serqio.I solve this problem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=41643&amp;title=sorting-in-reportcontrol#41643</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4605">zitz</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 05 October 2008 at 7:24am<br /><br />Hi, Serqio.<br>I solve this problem by calling ReSortRows() after Populate()<br>(Xtreme ToolkitPro v11.2.0)<br><br>void CReportControlEx::Populate()<br>{<br>&nbsp;CXTPReportControl::Populate();<br>&nbsp;ReSortRows();<br>}<br>]]>
   </description>
   <pubDate>Sun, 05 Oct 2008 07:24:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=41643&amp;title=sorting-in-reportcontrol#41643</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl : Hi, Now, I know more about this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=38024&amp;title=sorting-in-reportcontrol#38024</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2347">Sergio</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 09 July 2008 at 4:16am<br /><br /><P>Hi,</P><DIV></DIV>Now, I know more about this issue.<DIV></DIV><DIV>&nbsp;</DIV><DIV>This problem doesn't occur if you clear the sort before modifying records.</DIV><DIV>&nbsp;</DIV><DIV>Here is my code :</DIV><DIV>============</DIV><DIV>&nbsp;</DIV><DIV>////////////////////////////////////////////////////<BR>// Clear sort<BR>////////////////////////////////////////////////////<BR>int nTopRow = m_pRP-&gt;GetTopRowIndex(); // store the first displayed row index <BR>CXTPReportColumnOrder* pSortOrder = m_pRP-&gt;GetColumns()-&gt;GetSortOrder();</DIV><DIV>CArray&lt;CXTPReportColumn*, CXTPReportColumn*&gt; aReportColumns;<BR>CArray&lt;BOOL, BOOL&gt; aSortAscending;<BR>for (int i=0; i&lt;pSortOrder-&gt;GetCount(); i++)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp; aReportColumns.Add(pSortOrder-&gt;GetAt(i));<BR>&nbsp;&nbsp;&nbsp;&nbsp; aSortAscending.Add(pSortOrder-&gt;GetAt(i)-&gt;IsSortedIncreasing());<BR>}</DIV><DIV>m_pRP-&gt;FClearSort();</DIV><DIV>&nbsp;</DIV><DIV>////////////////////////////////////////////////////<BR>// ...<BR>// Modify records and child records<BR>// ...<BR>////////////////////////////////////////////////////</DIV><DIV>&nbsp;</DIV><DIV>////////////////////////////////////////////////////<BR>// Restore sort<BR>////////////////////////////////////////////////////<BR>for (int i=0; i&lt;aReportColumns.GetSize(); i++)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp; m_pRP-&gt;GetColumns()-&gt;InsertSortColumn(aReportColumns.GetAt(i));<BR>&nbsp;&nbsp;&nbsp;&nbsp; aReportColumns.GetAt(i)-&gt;SetSortIncreasing(aSortAscending.GetAt(i));<BR>}</DIV><DIV>m_pRP-&gt;FRefreshSort();<BR>m_pRP-&gt;SetTopRow(nTopRow); // Restore the index of the first displayed row of the report<BR></DIV>]]>
   </description>
   <pubDate>Wed, 09 Jul 2008 04:16:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=38024&amp;title=sorting-in-reportcontrol#38024</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl : Hi,  I have just downloaded...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=37731&amp;title=sorting-in-reportcontrol#37731</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2347">Sergio</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 02 July 2008 at 12:10pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>I have just downloaded and checked this issue with the MFC Codejock Release 12.0.0.</DIV><DIV>&nbsp;</DIV><DIV>There is still the same problem.</DIV><DIV>&nbsp;</DIV><DIV>Have you been able to reproduce this problem ?</DIV>]]>
   </description>
   <pubDate>Wed, 02 Jul 2008 12:10:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=37731&amp;title=sorting-in-reportcontrol#37731</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl : Hi,  Any news ? ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=36790&amp;title=sorting-in-reportcontrol#36790</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2347">Sergio</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 16 June 2008 at 10:10am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Any news ?</DIV>]]>
   </description>
   <pubDate>Mon, 16 Jun 2008 10:10:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=36790&amp;title=sorting-in-reportcontrol#36790</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl : While looking inside using the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=33749&amp;title=sorting-in-reportcontrol#33749</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2347">Sergio</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 16 April 2008 at 8:14am<br /><br /><P>While looking inside using the debugger, it seems that there's&nbsp;a confusion between these Rows arrays :</P><FONT color=#010001 size=2><P>&nbsp; - CXTPReportRows</FONT><FONT size=2>* </FONT>m_pPlainTree</P><DIV><FONT color=#010001 size=2>&nbsp; - CXTPReportRows</FONT><FONT size=2>* </FONT>m_pRows</DIV><DIV>&nbsp;</DIV><DIV><strong><img src="http://forum.codejock.com/smileys/smiley3.gif" border="0">&nbsp;They both hold pointers to the same object, but the <FONT color=#010001 size=2>CXTPReportRow class can hold only one parent Rows.</FONT></strong></DIV><DIV>&nbsp;</DIV><DIV>I have tried to force the refresh of indexes, using a class overriden from the CXTPReportControl one&nbsp;:</DIV><FONT size=2><DIV>&nbsp;</DIV><DIV>void CMyXTPReportControl::RefreshDisplay()<BR>{<BR>&nbsp;&nbsp;&nbsp; &nbsp;m_bRefreshIndexes = TRUE;<BR></DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Populate();</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pHeaderRows-&gt;RefreshChildIndices(TRUE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pRows-&gt;RefreshChildIndices(TRUE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pFooterRows-&gt;RefreshChildIndices(TRUE);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pPlainTree-&gt;RefreshChildIndices(TRUE);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_arrScreenRows.RefreshChildIndices(TRUE);<BR>}</DIV><DIV>&nbsp;</DIV><DIV>void CMyXTPReportControl::RefreshSort()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_bRefreshIndexes = TRUE;<BR></DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReSortRows();</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pHeaderRows-&gt;RefreshChildIndices(TRUE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pRows-&gt;RefreshChildIndices(TRUE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pFooterRows-&gt;RefreshChildIndices(TRUE);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pPlainTree-&gt;RefreshChildIndices(TRUE);</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_arrScreenRows.RefreshChildIndices(TRUE);<BR>}<BR></DIV><DIV>But it just moved the problem... <img src="http://forum.codejock.com/smileys/smiley19.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV><strong><FONT color=#ff0000>H E L P !</FONT></strong></DIV></FONT>]]>
   </description>
   <pubDate>Wed, 16 Apr 2008 08:14:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=33749&amp;title=sorting-in-reportcontrol#33749</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl : Hi,  In fact, there&amp;#039;s really...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=32136&amp;title=sorting-in-reportcontrol#32136</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2347">Sergio</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 11 March 2008 at 7:07am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>In fact, there's really a bug in Release mode : <img src="https://forum.codejock.com/smileys/smiley11.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV align=center><img src="https://forum.codejock.com/uploads/20080311_070347_BugCodejock.JPG" border="0"></DIV><DIV align=left>Hope to get an answer now...</DIV><DIV align=left>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 11 Mar 2008 07:07:17 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=32136&amp;title=sorting-in-reportcontrol#32136</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl : Hi,  We have the same problem.  It...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=31142&amp;title=sorting-in-reportcontrol#31142</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2347">Sergio</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 13 February 2008 at 6:07am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>We have the same problem.</DIV><DIV>&nbsp;</DIV><DIV>It seems to be linked to the sorted column.</DIV><DIV>&nbsp;</DIV><DIV>This error comes when you add a child record, with the <FONT color=#010001 size=2>SetSortRecordChilds</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>TRUE</FONT><FONT size=2>) activated, and with one or more&nbsp;columns sorted.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>If no column is sorted, the problem doesn't occur.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>We&nbsp;think that's a bug of the Report Control.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Regards,</FONT></DIV>]]>
   </description>
   <pubDate>Wed, 13 Feb 2008 06:07:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=31142&amp;title=sorting-in-reportcontrol#31142</guid>
  </item> 
  <item>
   <title><![CDATA[Sorting in ReportControl :  I recently turned on sort for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=28334&amp;title=sorting-in-reportcontrol#28334</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=507">myddyn</a><br /><strong>Subject:</strong> 8741<br /><strong>Posted:</strong> 09 November 2007 at 5:23pm<br /><br /><FONT size=2><DIV>I recently turned on sort for child by using <FONT size=2>SetSortRecordChilds(TRUE);</FONT></DIV><DIV>&nbsp;</DIV><DIV>and now get an ASSERT in the follow function.</DIV><DIV>&nbsp;</DIV><DIV>CXTPReportRow* CXTPReportRow::GetNextSiblingRow() </FONT><FONT color=#0000ff size=2>const</DIV></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (!m_pParentRows)</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> 0;</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_nChildIndex == -1)</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> 0;</P><P>ASSERT(m_pParentRows-&gt;GetAt(m_nChildIndex) == </FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_nChildIndex &lt; m_pParentRows-&gt;GetCount() - 1)</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> m_pParentRows-&gt;GetAt(m_nChildIndex + 1);</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> 0;</P><DIV>}</DIV><DIV></DIV><DIV></DIV>After doing a little debug, it seem that the record it is getting the <DIV>itself because the record has moved but the index is the same.&nbsp; If I ignore all the ASSERT the program and sort execute correctly.&nbsp; If I take out the code that moves the children around it works correctly.</DIV></FONT>]]>
   </description>
   <pubDate>Fri, 09 Nov 2007 17:23:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8741&amp;PID=28334&amp;title=sorting-in-reportcontrol#28334</guid>
  </item> 
 </channel>
</rss>