[DISCUSSION] Reportcontrol vs Listview |
Post Reply |
Author | |
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Posted: 11 February 2008 at 3:48am |
Hi,
When I looked at the sample where the reportcontrol is used in virtualmode and filling the list with lets say 1 million records in uhhh 1 second?!?! I thought wow!!!! This is what I need
But there's always a catch, I thought to myself. Is there? I'm currently using a listview to fill a large amount of records from a database. I don't know with which of the controls will have the best performance: Reportcontrol or Listview. Can someone tell me this? Maybe someone did a test with these controls, so a sample would be great of course, just to see the difference (in performance) between the 2 controls.
Thanks in advance
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
Note that in virtual mode you actually do not real records -- there is only 1 "virtual" record, which you can play with on various events handlers. The list is filled only with data for those records which are visible for a moment. In virtual mode there are no difference whether you have 1000 or millions records. -- WBR, Serge |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Suppose, I have a table in database which contains about 1 million records, and I want to load the data into the report control. Do I have to add one record at a time to the report control or the entire table? And afterwards I can navigate through the items?
Thanks in advance
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
I did some tests with ReportControl's VirtualList. I would say this is a great control if you want to load lots of data. My app generates an event for every action and will be saved in a csv file.
Loading about 1000 files (contains 1,5 million rows with 11 cols) in 16 seconds, thats about 95.000 records in one second
Internal memory decreased about 700 Mb, minor problem these days
The rows will be loaded into an array and with the BeforeDrawRow shown to the user. Then the user wants to do a search operation in the super listview and plop in 0,0001 seconds the ReportRecordItem area will be painted in a color he/she selected and this with 20 search items at one time
I know its only virtual but the user doesn't hahaha. Great !!!
The only negative about the virtual list: you cannot sort items! Or you have to do the sorting within your array but that will take more time and we don't want that
|
|
Smucker
Senior Member Joined: 02 February 2008 Status: Offline Points: 156 |
Post Options
Thanks(0)
|
You could repopulate the control when sorting, using ORDER BY on the query to the database.
|
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
I load the rows from a file (csv) into an array, not from a database. When loading the rows into a recordset its taking a lot longer. You will have sorting thats true. I will have a look at it in the near future.
Thanks anyway
|
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Did you try to connect to the CSV in ADO?
I use the Ado CSV connector for many of my softs in vb6 and the recovery of the recordset is rather fast even for hundreds of thousand lines.
Once you have the recordset the order is easy.
In fact, I do not see what CodeJock can make to by-pass the problem. The virtual mode imposes this kind of limitations i think.
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
I knew in advance that the virtuallist couldn't be sorted, this isn't an issue. I was just explaining to my fellow CJ users how fast you can display a hugh amount of data.
When assigning values to an array you don't have to put so much effort in it:
fnum = FreeFile
Open strFile For Input As fnum wholeFile = Input$(LOF(fnum), #fnum) Close fnum lines = Split(wholeFile, vbCrLf)
numberOfRows = UBound(lines) totalNumberOfRows = totalNumberOfRows + numberOfRows For R = 0 To numberOfRows - 1 arrayItems(R) = Split(lines(R), ",") next R
Done..... 65000 records loaded in 1 second (800Mhz machine) and ready to use for the ReportControl. The tests I did with the 1,5 million records I did in the office (3.1 Mhz and lots of memory )
Well if you would use a recordset things get a little slower, you have to assign a value for each field and this will take time. I tested this and it will take about 2,5 seconds MORE to fill the data (65000 records, same machine!). So loading 1,5 million records would take 60-70 seconds longer. I think you better load the records directly into the reportControl and then you will have sorting.
OR do you have an idea of doing this in another way, could be, I'm open to all ideas. |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
@aaron
could you possibly show us the code how you load data from a recordset? right now im still not using the cj report control as i am still using itgrid because of very fast data loading from recordset. statements like: set itgrid.datasource = rs can actually load 50,000 actual records from the database in half a second maybe this could change (i may have the chance to use the report control) if i could get to know how to load recordset into the report control. thanks |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |