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!

Do I need a sub-report for this? 2

Status
Not open for further replies.
Mar 10, 2004
53
US
Hi,

Creating a summary report with raw data looking like below:

Acknowledge Closure
Priority Compliant Compliant
--------------------------------------
1 y y
1 y n
1 n n
2 y y
2 y n

Would like to summarize it to look like:

Acknowledge Closure
Priority Compliant Compliant
--------------------------------------
GH1 1
GF1 Y 2 1
GF1 N 1 2
---------------------------
GF2 3 3

GH1 2
GF1 Y 2 1
GF1 N 0 1
---------------------------
GF2 2 2


I'm fine up to the point of grouping the Acknowledge Compliant. Having problems grouping the Closure Compliant in which my summary totals get screwed up when I move the summary field in the same Group Footer location as the Acknowledge Compliant.

Was going to do two subreports and lay them side by side but was hoping I shouldn't have to.

thanks in advance.
 
Subreport is almost always the very last option!!!
one way is to create a number of variables

The grouping is on the Priority

in GH place a formula field @initVar
whilePrintingRecords;
numbervar AckY:=0;
numbervar AckN:=0;
numbervar ClosY:=0;
numbervar ClosN:=0;

in detail
place a formula field @calcVar
whilePrintingRecords;
numbervar AckY;
numbervar AckN;
numbervar ClosY;
numbervar ClosN;
if AckComp='Y' then AckY=AckY+1 else AckN=AckN+1
if ClosComp='Y' then ClosY=ClosY+1 else ClosN=ClosN+1

In GF1 put four formula fields
@AckY
whilePrintingRecords;
numbervar AckY;
AckY;

@AckN
whilePrintingRecords;
numbervar AckN;
AckN;

@ClosY
whilePrintingRecords;
numbervar ClosY;
ClosY;

@ClosN
whilePrintingRecords;
numbervar ClosN;
ClosN;

In GF2 put 2 formula fields

@AckT
whilePrintingRecords;
numbervar AckY;
numbervar AckN;
AckY+AckN;

@ClosT
whilePrintingRecords;
numbervar ClosY;
numbervar ClosN;
ClosY+ClosN;

Voilà!


--------------------------------------------------
[highlight]Django[/highlight] [thumbsup]
bug exterminator
tips'n tricks addict
 
The simplest approach might be to create formulas:

//{@ackY}:
if {table.ack} = "Y" then 1 else 0

//{@ackN}:
if {table.ack} = "N" then 1 else 0

//{@closY}:
if {table.clos} = "Y" then 1 else 0

//{@closN}:
if {table.clos} = "N" then 1 else 0

Place these in the details section and then right click on each one and insert a summary (SUM, not count). If there are always either a "Y" or an "N" in the fields, for the total per Priority group, you could right click on one of the formulas and insert a count on it. If there might be nulls, and you don't want to count them, then you could create additional total formulas:

//{@totalack}:
{@ackY} + {@ackN}

//{@totalClos}:
{@closY} + {@closN}

-LB
 
thank's LBass I don't practice summaries a lot.
Isn't Whileprintingrecords necessary in the formulas?

--------------------------------------------------
[highlight]Django[/highlight] [thumbsup]
bug exterminator
tips'n tricks addict
 
No, not necessary. In fact, if you added that, the ability to insert summaries would be eliminated, since "whileprintingrecords" forces evaluation at print time, instead of as records are being read.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top