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!

Group Total only for the records display

Status
Not open for further replies.

rajasan77

Programmer
Jan 12, 2010
30
US
I have a report that suppress the records in detail section based on the parameter value.

When I suppress the records in detail section, I should get total in the group header only the for the records that are displayed.

But, I am getting total for all the records including that are suppressed.

How would I do the total count only for the records not suppressed in details section. I shoule get the total in group header(s).

Thanks.
 
A running total can total for every record that meets some particular formula rule. Do this as the reverse of the suppression formula.

If you're not already familiar with Crystal's automated totals, see FAQ767-6524.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
This is my suppression formula:

{@Suppress_NonConsecutive}=1
 
You need to show the content of any nested formulas when asked for formula content.

-LB
 
Here is the contents:
Suppress formula:
----------------------
{@Suppress_NonConsecutive}=1

Content of {@Suppress_NonConsecutive}:
-----------------------------
if {?Consecutive}= 'Consecutive'and {@Consecutive}= 0
then
1
else
0

content of {@Consecutive}
------------------
If (
(Not IsNull({@End_Time_Previous}) and {@End_Time_Previous}={ES_TIME_ON_HOLD.BEGIN_TIME})
OR
(Not IsNull({@Begin_Time_Next}) and {@Begin_Time_Next}={ES_TIME_ON_HOLD.END_TIME})
) then
1
Else
0

{?Consecutive}:
-------------------
This parameter has two entries:
1. Consecutive
2. ALL

Thanks.
 
We are still missing the content of two nested formulas. However, I'm guessing they use next/previous functions, and therefore you will have to use running totals to count the displayed records, where you use a formula in the evaluation section:

{@Suppress_NonConsecutive}=0

If you need this in the group header, you will have to save the current report under another name and use it as a subreport in the group header and link it on the group fields. Then suppress all sub sections but the section containing the running total.

-LB
 
When I use the formula in running toal. I get the following error:

"A Running total cannot refer to a print time formula details:mad:suppress_NonConsecutive
 
Oh, yes, sorry. I guess you will have to use a variable, as in:

whileprintingrecords;
numbervar cnt;
if {@Suppress_NonConsecutive} = 0 then
cnt := cnt + 1;

In the group footer, use a formula to display the result:

whileprintingrecords;
numbervar cnt;

In the group header, use a formula to reset:

whileprintingrecords;
numbervar cnt;
if not inrepeatedgroupheader then
cnt := 0;

To get the result displayed in the group header, save the report under another name and then insert it as a subreport in the group header. Link the sub to the main report on the group field (and on any higher order group fields), and then suppress all sections within the sub except the group footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top