I have a report item which is based on a calculation from 2 different entities.
I am trying to group the report based on the product number.But I am not able to get the total for each group. But found a way to get the grand total from the report using the following code.
I want to find a way to aggregate the total for each product and set it to zero when it moves to the next product.
Already tried: Creating a separated calculated field to the data-set but as it is from from 2 different data sets so I am not able to create a calculated field. Tried referencing the aggregate elsewhere in the report and tried to reference it, did not work.
Public totalReplacement as Integer
Public totalGSF as Integer
Public Function AddTotalReplacement(ByVal replacement AS Integer )
totalReplacement = totalReplacement + replacement
End Function
Public Function AddTotalGSF(ByVal thisGSF AS integer)
totalGSF = totalGSF + thisGSF
End Function
Public Function GetTotalReplacement()
return totalReplacement
End Function
Public Function GetTotalGSF()
return totalGSF
End Function
The above code keeps adding the total of each product with the before total. But I wish to the make the total replacement zero when it move to the next product.