07-27-2010 11:54 AM
Hello,
I'm using SetTableCellRangeVals in order to fill a table (6 string columns, 1 numeric column and 250 rows).
First, I load the panel, I fill the table, and I display the panel. The time to display the table is very fast. The problem occurs when I update this table, the time to display all values is very long (4 or 5 s)
How can i do to reduce this time ?
For the moment, my program is :
while (compt < 250) { strcpy(sTexte[0],sDate); strcpy(sTexte[1],sType); strcpy(sTexte[2],sEtat); strcpy(sTexte[3],sMessage); strcpy(sTexte[4],sMessage2); strcpy(sTexte[4],sTest); SetTableCellRangeVals (giPanelRapports, JOURNAL_TABLE, MakeRect (compt+1, 1 , 1, 6), sTexte, VAL_ROW_MAJOR); SetTableCellRangeVals (giPanelRapports, JOURNAL_TABLE, MakeRect (compt+1, 7 , 1, 1), &iRef, VAL_ROW_MAJOR); if(strcmp("test1",sEtat)==0) { SetTableCellRangeAttribute(giPanelRapports,JOURNAL_TABLE,MakeRect (compt+1, 1 , 1, 7),ATTR_TEXT_COLOR,giCouleurTexteJournal[i][0]); SetTableCellRangeAttribute(giPanelRapports,JOURNAL_TABLE,MakeRect (compt+1, 1 , 1, 7),ATTR_TEXT_BGCOLOR,giCouleurFondJournal[i][0]); } if(strcmp("test2",sEtat)==0) { SetTableCellRangeAttribute(giPanelRapports,JOURNAL_TABLE,MakeRect (compt+1, 1 , 1, 7),ATTR_TEXT_COLOR,giCouleurTexteJournal[i][1]); SetTableCellRangeAttribute(giPanelRapports,JOURNAL_TABLE,MakeRect (compt+1, 1 , 1, 7),ATTR_TEXT_BGCOLOR,giCouleurFondJournal[i][1]); } compt++; }
Thanks a lot
Benjamin
Solved! Go to Solution.
07-27-2010 02:45 PM
The usual tricks that can improve table performance are to set another control as the active control while updating the table and to hide the table itself before accessing it.
Additionally, I would try converting the program so that values are written in columns, which will reduce the numer of updates to 7 instead of 250.
Another attempt could be to examine update time with and without setting cell colors
07-28-2010 03:42 AM
Thanks a lot for your answer.
I just set the control invisible before loading data, and it works very well. The data are loaded from a database, for the moment, I prefer fill the table by row.
Thank you very much for your help.
Benjamin