<?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 bug if GetGroupCapti&#111;n overridden</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Sorting bug if GetGroupCapti&#111;n overridden]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 20:13:31 +0000</pubDate>
  <lastBuildDate>Fri, 16 Sep 2005 14:48:13 +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=2907</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 bug if GetGroupCapti&#111;n overridden : I just spent a fair bit of time...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2907&amp;PID=8661&amp;title=sorting-bug-if-getgroupcaption-overridden#8661</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1003">Warren</a><br /><strong>Subject:</strong> 2907<br /><strong>Posted:</strong> 16 September 2005 at 2:48pm<br /><br /><span style="font-family: Tahoma;"><o:p></o:p></span><span style="font-family: Tahoma;">I just spent a fair bit oftime tracking this down, so I’d like to let everyone know about it, andhopefully someone from Codejock can comment on it too.<o:p></o:p></span><p ="Ms&#111;normal"><span style="font-family: Tahoma;">If you override <span style="color: black;">GetGroupCaption (e.g. to return “2003” for all dates in theyear 2003 for a date) this will cause the sorting to be incorrect when you groupby more than one column. (where the column with the overridden GetGroupCaptionis the primary group).</span><o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;"><o:p>&nbsp;</o:p>this is because the lastline of the function:<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: black;">CXTPReportRecordItem</span><span style="font-family: Tahoma;">::<span style="color: black;">CompareGroupCaption<o:p></o:p></span></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: black;">is:</span><span style="font-family: Tahoma; color: blue;"><o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: blue;">return</span><span style="font-family: Tahoma;"> <span style="color: black;">Compare</span>(<span style="color: black;">pColumn</span>, <span style="color: black;">pItem</span>);<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;"><o:p>&nbsp;</o:p><br>This goes in and comparesthe actual data values, ignoring the overridden caption text. <o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;"><o:p>&nbsp;</o:p>The fix is to override <span style="color: black;">CompareGroupCaption, and write:<o:p></o:p></span></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: blue;">return</span><span style="font-family: Tahoma;"> <span style="color: black;">GetGroupCaption</span>(<span style="color: black;">pColumn</span>).<span style="color: black;">Collate</span>( <span style="color: black;">pItem</span>-&gt;<span style="color: black;">GetGroupCaption</span>(<span style="color: black;">pColumn</span>) );<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;"><o:p>&nbsp;</o:p></span><br><span style="font-family: Tahoma; color: black;">This compare thecaptions (from the overridden GetGroupCaption), rather than the actual datavalues.<o:p> <br></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: black;"><o:p></o:p>I would suggestthat the last line of CXTPReportRecordItem</span><span style="font-family: Tahoma;">::<span style="color: black;">CompareGroupCaption<o:p></o:p></span></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: black;">be changedfrom:<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: blue;">return</span><span style="font-family: Tahoma;"> <span style="color: black;">Compare</span>(<span style="color: black;">pColumn</span>, <span style="color: black;">pItem</span>);<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;">to<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma; color: blue;">return</span><span style="font-family: Tahoma;"> <span style="color: black;">GetGroupCaption</span>(<span style="color: black;">pColumn</span>).<span style="color: black;">Collate</span>( <span style="color: black;">pItem</span>-&gt;<span style="color: black;">GetGroupCaption</span>(<span style="color: black;">pColumn</span>)<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;">Hopefully, what I’m suggestingis correct - can someone from Codejock please comment on this.<o:p></o:p></span></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;">Thanks<o:p></o:p></span></p><p ="Ms&#111;normal"><st1:City w:st="&#111;n"><st1:place w:st="&#111;n"><span style="font-family: Tahoma;">Warren<br><br></span></st1:place></st1:City></p><p ="Ms&#111;normal"><span style="font-family: Tahoma;"><o:p>...or failing that, there should be a HUGE </o:p></span><span style="font-family: Tahoma;">warning comment in the </span><span style="font-family: Tahoma;"><o:p>functions telling you that you MUST override </o:p></span><span style="font-family: Tahoma;"><span style="color: black;">CompareGroupCaption if you override </span></span><span style="font-family: Tahoma;"><span style="color: black;">GetGroupCaption.</span></span></p><p ="Ms&#111;normal"><br><st1:City w:st="&#111;n"><st1:place w:st="&#111;n"><span style="font-family: Tahoma;"></span></st1:place></st1:City><span style="font-family: Tahoma;"><o:p></o:p></span></p>]]>
   </description>
   <pubDate>Fri, 16 Sep 2005 14:48:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2907&amp;PID=8661&amp;title=sorting-bug-if-getgroupcaption-overridden#8661</guid>
  </item> 
 </channel>
</rss>