Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total Field on Group Header 1

Status
Not open for further replies.

josearturoramirez

Programmer
Jul 7, 2006
11
US
Hi

I need to locate a Running total field on the header side of a group.

When i put this field i put this RTF on the foot of the group it takes a value, but if i move it to the header it take a diferent value.

I'm using Access, VB6, CR 9.0

Thanks!
 
What are you trying to accumulate? Please provide more information on what you are trying to do. Running totals accumulate record by record, so if you place one in the group header, it will reflect the total up through the first record of that group, not the group total.

-LB
 
Ok, look.

Accruals is hours that employees earn according rules.

This is an Employee Accruals Report

In the header i need to shows how many hours this employee has earned before the selection date (before or at date1) and in the foot how many hours after selection date (before or at date2)

To do that i select the entire table from de DB an suppres all records that is out of the interval.

i added the same inverted suppresing formula to Running total fields to sum only the records that has not been suppressed.

the case is this:

in the table i have hours_accrued and hours_used

the RTF in the header is set to show a value that could be interpreted like this: select (sum(hours_accrued) - sum(hours_used)) as value from table where date < @date1

the formula for the RTF on the foot is almost the same, the only diference is the date (@date2).

when i run the reports, there is an employee that in the has no transactions in the date interval.

like all records for this employee has been suppresed, the report only show header an foot. the RTF at header shows 200.00 and at the foot 197.00

header value come from @BegBalance = #Accr - #Used
Foot value is almost the same, and like i said the only diference is the date.
@EndBalance = #AccrEnd - #UsedEnd.

if there arent transacionts in this periods this to value supose to be the same.

IMPORTANT.

#Used and the header is 0.00 or Null, but if i drag it to the foot i take the espected value 3.00.

i need to get the real values at the header.
 
I don't know how you've set up {#used} but you should have be using an evaluation formula in the evaluation section of the running total that uses the opposite of your suppression criteria.

Note also that a running total in a group header will pick up the value of the first record in that group--not sure whether this is part of your issue.

-LB
 
OK, look.

Don't use a Running Total, they accumulate as they go through the details, not prior. Also there are report headers and footers, and there are page headers and footers, try to be precise in your descriptions.

You want standard Crystal aggregates, as in:

if {table.date} <= date1 then
{table.value}
else
0

if {table.date} > date1 then
{table.value}
else
0

Now you can palce these formulas in the details, right click them and select insert summary at the group level, and then after they are placed in the group footer drag them to the group header.

You can even delete them from the detail section afterward if you like.

This should get you close, or at least allow you to understand why you are currently getting bad results.

Also in the future try to avoid the urge to state business rules, all we probably need to see is some example data being returned to the database, and the output you require of it.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top