I need to print a table with some total and then a second table with detailed events. Then I need to change the total of each total of the first table considering the number