Print Page | Close Window

ReportControl tree sorting

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2185
Printed Date: 08 November 2025 at 2:26am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportControl tree sorting
Posted By: haiku
Subject: ReportControl tree sorting
Date Posted: 05 May 2005 at 1:59am

How to sort tree in ReportControl to sort subtrees also ? Has anyone know some fast way how to do that ? Now you can sort only the top most leaves in the tree.

Thank you for help, Haiku.




Replies:
Posted By: haiku
Date Posted: 05 May 2005 at 2:09am

I have changed the source code (this works fine):

void CXTPReportRows::Sort(bool bSortChildren)

{

    if (bSortChildren)

    {

         for(int i=0; i<GetCount(); ++i)

         {

               GetAt(i)->GetChilds()->Sort(bSortChildren);

         }

     }

      typedef int (_cdecl *GENERICCOMPAREFUNC)(const void *,const

      void*);

      qsort(m_arrRows.GetData(), (size_t)m_arrRows.GetSize(), sizeof    (CXTPReportRow*), (GENERICCOMPAREFUNC)CompareRows);

}

 

 




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