# Problem calculating variables for totals.

think before the current properties were added. I'm trying to modify it

to use the CalcType, ResetType, etc. I can't quite get it to work.

What I have is similar to this; Imagine data with Departments and

Employeees. I created 2 variables - one to calculate the total of some

column for each employee and one to calculate the total of the same

column for all employees in one department. These total variables are

supposed to print in the total sections with other data.

I tried the various choices and can't get anything but zero. How should

I be setting these variables?

This discussion has been closed.

## Comments

First I suggest taking a look at the following article on using

calculations in ReportBuilder.

http://www.digital-metaphors.com/rbWiki/Delphi_Code/Calculations/Overview

To calculate a Total with a Variable, make sure it's data type is set to

a numeric type and Calc type is Traversal. Then in the OnCalc event

increase the value.

Value := Value + ppReport.DataPipeline['MyField'];

Regards,

Nico Cizik

Digital Metaphors

http://www.digital-metaphors.com

Nico Cizik

Digital Metaphors

http://www.digital-metaphors.com