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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anyone tell me how can I get th

Status
Not open for further replies.

jcl5

IS-IT--Management
Dec 6, 2002
89
GB
Can anyone tell me how can I get the results of my conditional running totals to appear in the report header instead of the report footer?

Thanks

jcl
 
Running Totals are not calculated yet in the report header. If you need to have that value available in the Report Header, you will need to go about it by another means.

Please provide more information regarding what you are trying to do, and someone here can help out. Provide what type of calculation you are trying to perform (count, sum, etc), data type of field you are counting, and if the are any conditions involved with determing the summary.

Verison of Crystal, and Database type might bew helpful as well.

~Brian
 
I am using Crystal 9 with Oracle 8i database.

They are very simple totals:-

Total 1

Calculation is a distinct count on a number field (PROGRAMID)

Evaluation is using the formula - isnull({PRG_AREA})

Reset - Never

Total 2

Calculation is a distinct count on a number field (PROGRAMID)

Evaluation is using the formula - not isnull({PRG_AREA})

Reset - Never


Thanks

jcl
 
Create 2 formulas, one for counting null program ids and one for counting not null program ids.
***********************************
@Count_Null_Program_ID
Code:
If isnull({table.PROGRAMID}) then
    1
else
    0
***********************************
@Count_Not_Null_Program_ID
Code:
If isnull({table.PROGRAMID}) then
    0
else
    1
***********************************
Place these 2 formulas in your detail section.
Next, Right click each field and choose Insert, Grand Total.
Make sure the type is Sum, then click OK.
By default it will add the 2 totals to the Report Footer. Just drag the field to the Report Header and your done.

~Brian
 
Not quite working - the null is giving me the correct number but the not null isn't - there's lots of group headers in the report - would that affect this calculation?
 
Could some of the values be spaces rather than nulls? You may want to change the one formula like this:

@Count_Not_Null_Program_ID
Code:
If isnull({table.PROGRAMID}) or LEN(TRIM({table.PROGRAMID}))> 0 then
    0
else
    1

~Brian
 
A different solution is to place a subreport in the report header and do the counting there. Expensive in terms of maching time but saves programmer time and is more flexible.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top