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

Problem Printing total in group header.

Status
Not open for further replies.

azziuhc

Programmer
Apr 29, 2010
26
US
I am having a problem printing total in group header.
I am using CR 9 and having a problem suprressing group header based on conditional count.
Group header: Client, Client Name....
Detail: will print only if condition is met. (using suppress)

all counter/formula are are working ok, with the exception of how to display the record count in group header (it works in group footer)

I am using the following:
//@CountReset
//Placed in report footer and group footer
WhilePrintingRecords;
Numbervar ncount:=0;

//@CountRec
// placed in detail section
Whileprintingrecords;
numbervar ncount;
if {@F compare}=0 then
ncount:=ncount+1

//@CountDisplay
//to print the contents
//(working ok - placed in group footer//
//*** need to place it in Group Header
Whileprintingrecords;
numbervar ncount;
ncount

Please advice
Thank you
d
 
What is the content of {@F compare}? You should ALWAYS show the content of nested formulas, as it can affect solutions proposed.

-LB
 
Thank you for getting with me
{@F compare} = instr(text,look_var)

I need to check the formuladid a mistypo
//@CountRec//
Whileprintingrecords;
numbervar ncount;
if {@F compare}=1 then
ncount:=ncount+1

Basically= I am looking to exclude all those that are not included in the look_var

So I am excluding (or surpressing) detail lines whenever {@F compare} = 0

Thank you
Please advice
 
Don't use a variable. Instead, use a formula:

if {@F compare} = 1 then 1

Place this in the detail section->right click and insert a summary (SUM, not count) at the group level. Then drag the result into the group header.

This assumes that the contents of {@F Compare} are not themselves based on variables. When asked to show formula contents, please show the actual formula, not a paraphrase of it.

-LB
 
Thank you for the reply
I will try it tomorrow at work.
Much appreciate it I will let you know of the outcome.
D
 
Lbass:
Thanks for you info. It worked beautifull.
Actually it was easier than what I though.
This is what I did:
- use the formula: if (condition) then 1 else 0
- Summarize by formula
- Drag or copy the sum_Formula into the group header
- suppress based on sum_Formula
- it works!!!

(I learned that using total running or formula summarize do actually work **** ONLY IN FOOTER GROUP ****
Header Group: use the section above.
Thank you VERY Much.
Dre
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top