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!

Summary (Count) of "whileprintingrecords" Events 1

Status
Not open for further replies.

drkarr

IS-IT--Management
Aug 10, 2005
24
US
In Crystal 10 I have created a printable field which equals 1 if a condition is met and 0 otherwise. Since that "whileprintingrecords" field does not appear as a report field in the "Insert Summary" window, how can I count (i.e., total) the 1's that are printed?
 
Please post the actual formula.

Are you sure you need "whileprintingrecords"? Try removing it and see if the formula is then available.

-LB
 
Remove whileprintingrecords from the formula.

If that doesn't work, don't try to describe a formula, just post it.

-k
 
Thanks to lbass and synapsevampire. Eliminating "whileprintingrecords" allowed the formula to run OK, but it still doesn't appear in the "Insert Summary" list of formulas. Here is the formula which works:

numbervar dur := datediff("h",previous({@Date/Time End}),{@Date/Time Start});
if dur<12 and dur>=0 then 1

My challenge is to sum the 1's for each group in the report.
 
The issue is your use of the previous function. Change your formula to:

whileprintingrecords;
numbervar dur := datediff("h",previous({@Date/Time End}),{@Date/Time Start});
numbervar cnt;
numbervar currentrec := 0;
if dur<12 and dur>=0 then (
cnt := cnt + 1;
currentrec := 1
);
currentrec

Place a reset formula in your group header:
whileprintingrecords;
numbervar cnt := 0;

Place a display formula in your group footer:
whileprintingrecords;
numbervar cnt;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top