Hi, Mahmood.
> I have a problem that is driving me mad. I am trying to calcualate the values of total hours depending on the type of job in my cursor. Fox example, if job is "Labor" then calculate the total hours for Labor and so on. I want to place the value of total hours at the header level. What I did was to create a variable call nHours in the report variable and store creport.hours in the nHours and selected Sum option from calculate box. In the printwhen section I enter :
>
>IIF(Between(creport.type,1,2),sum(nhours),0) && (1..2 is labor)
>The result that I get is zero. Now I know this is not true. What can I do to accomplish the output that I want.
You have to put this code in the Expression field, not the Print When.
Also, you have to select sum for your field with the calculation button, not a function.
You can solve you problem with a combination of two.
Expression: nhours (push the calculate button and select SUM)
PrintWhen: Between(creport.type,1,2)