Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - ReportControl tree sorting
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ReportControl tree sorting

 Post Reply Post Reply
Author
Message
haiku View Drop Down
Newbie
Newbie


Joined: 30 November 2004
Location: Poland
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote haiku Quote  Post ReplyReply Direct Link To This Post Topic: ReportControl tree sorting
    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.

Back to Top
haiku View Drop Down
Newbie
Newbie


Joined: 30 November 2004
Location: Poland
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote haiku Quote  Post ReplyReply Direct Link To This Post 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);

}

 

 



Edited by haiku
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.