Add totalizers to the ExportReport

By default The ExportReports include all the records of the grid that we see on the screen, but in the case that in our grid we have totalizers, they are only shown from version 14, for previous versions they are not shown.

To add the totalizers in the ExportReports, the following steps must be followed.

1 - In the 'CalculateTotalizers' event we are going to add a code that saves the totalizer value in the session:

&Session.Set("CustomerWWCustomerIdTotal", &TotalValueCountryId)

CalculateTotalizers 1

2 - Next, in the PDF procedure, add a Printblock called 'user_Totalizers' (print blocks that start with 'user_' are not excluded by pattern):

CalculateTotalizers 2

3 - Then in the Source of the procedure we are also going to load the content of the printblock, making use of the value that we save in session, in the PDF is as follows:

&CustomerIdTotal = &Session.Get("CustomerWWCustomerIdTotal")

print user_Totalizers

CalculateTotalizers 3

For Excel, it's simpler than PDF, you only need to add the following code at the end of "WriteData":

&ExcelDocument.Cells(&CellRow, &FirstColumn + &VisibleColumnCount).Text = &Session.Get("CustomerWWCustomerIdTotal")

CalculateTotalizers 4

Totalizers was implemented in WorkWithPlus for Web 14 Upgrade # 2.