(Sorry about my english). My company requirements are more sophisticated for the usage of Table or DataTable. None of them do things like iReport , for that reason i implement over your code some changes that not touch anything of the main code but add support for groups and totals on groups , see the images.
Note: the excessive colors , strange format , etc are for show posible definitions of the totals.
The memory usage is better now and the grouping use less array elements (a lot less) and support format,css,etc for the totals.
The execution time showed is the time to create groups and totals for the near 19,000 records of the sample data.
The question is , i send the code as contribution or create a new widget? Is important for me that the base code can do this sort of things.