PxPlus User Forum

Twitter Twitter Twitter

Author Topic: How to speed up creating a Tree View List Box  (Read 95 times)

Dave Fullerton

  • Member
  • **
  • Posts: 14
    • View Profile
How to speed up creating a Tree View List Box
« on: September 20, 2019, 04:59:19 PM »
Hi folks:

We have a routine where the structure of a user defined financial statement gets transferred to a tree view list box.  There are four levels in this list box - a major group, a minor group, a line group, and then line details.  There are no graphics displayed.  Our client has one report that contains 81,141 lines to be loaded into the list box.

The user is in a WindX environment, on a Windows network.  They are running PxPlus V15. 

I hide the list box before displaying anything.  All data is loaded a line at a time.  After 65 minutes, approximately 77,000 records had been processed.  This is obviously waaaay too slow.  I had thought about putting everything into a variable to load everything at once, but I'm worried about error 31's.

Does anyone have any suggestions how to speed up the processing?

Thanks in advance

Dave Fullerton

ksproul

  • Member
  • **
  • Posts: 19
    • View Profile
Re: How to speed up creating a Tree View List Box
« Reply #1 on: September 20, 2019, 06:17:23 PM »

Dave,


With Mike King's help I was able to dramatically improve performance by doing the following:
1. Pre-sort the data using a memory file with a key definition that defines the each level as fields
2. Build a load string from the memory file.
3. Turn off the list box sorting feature ('sort=0).
4. Loading the data using the string.
5. Turn the list box sorting back on ('sort=1)


Mike explained that the performance was due to an inefficient built-in sorting mechanism with the windows list box control. So far we haven't exceeded the memory limits and we've loaded a lot more than 80k records with up to 6 levels.

Ken Sproul
DPI Information Services, Inc.

Dave Fullerton

  • Member
  • **
  • Posts: 14
    • View Profile
Re: How to speed up creating a Tree View List Box
« Reply #2 on: September 21, 2019, 05:24:38 AM »
Hi Ken:

Thanks for the tips. I'm wondering if the 'sort=0 may be the key to my issue.  I'll give it a shot.

Regards

Dave Fullerton