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

Finding a Grand Total in Crystal 8.5

Status
Not open for further replies.

nickayle

MIS
Joined
Jan 11, 2006
Messages
30
Location
BS
Hi,
Iam fairly new to crystal and new to this application. I have an inventory report that gives the qty on hand, the unit cost and the ext cost. I need to find the total on the ext cost. the extcost field is a formula: {@TInvQty}*{Inventory.LastCost), therefore not allowing the insert grand total function, how can i get a total on this formula?
Any help you can give would be most appreciated.

~nic~

 
You need to show the content of {@TInvQty} and of any nested formulas within it.

-LB
 
the formulas in this report seems to be never ending. And i would have taught to total some #'s would have been like taking candy from a baby. But i guess not. I got so far with this, then i got lost. This is my 2nd week working with this. I really hope you can help. thanks!

Here is what's in TInvQty

WhilePrintingRecords;
NumberVar TInvQty;
TInvQty;

I don't know if this is what is called nested, but since i see
the same name TInvQty I copy this as well.
TInvQtyReset

WhilePrintingRecords;
NumberVar TInvQty := 0;


TInvQtySet

WhilePrintingRecords;
NumberVar TInvQty;
TInvQty := TInvQty + {@TtlSiteQty}


TtlSiteQty

WhilePrintingRecords;
If IsNull (Sum ({@TSiteQtySet}, {vr_10630.SiteID}))
Then
{@RptBegQty}
Else
{@RptBegQty} + Sum ({@TSiteQtySet}, {vr_10630.SiteID})


TSiteQtySet

if {@askfield2} Then
0
Else


TSiteQtyReset

WhilePrintingRecords;
NumberVar TSiteQty := 0;
{@PStockQty}


RptBegQty

WhilePrintingRecords;
StringVar PerNbr;
PerNbr := '';
PerNbr := RIGHT({@BegPerNbr}, 2);

If ISNULL({vr_10630.FISCYR}) Then
0
Else
IF {vr_10630.FISCYR} = {@ReptBegYr} Then
{vr_10630.BegQty}
Else
0



BegPerNbr

RIPARAM("BegPerNbr")


ReptBegYr

LEFT(RIPARAM("BegPerNbr"),4)


Thanks Again!
~nic~
 
I think i missed these 2:

AskField2

if {vr_10630.trantype} = "AS" and {vr_10630.TRANDESC} = "Standard Cost Variance" OR {vr_10630.StkItem} = 0 Then
True
Else
False



PStockQty

{vr_10630.Qty}

thanks!
 
Hi Nick,

Grant Totals and Subtotals, infact any summaries (AVG, SUM etc) are calculated early in the passes which Crystal uses to create a report. This is done WhileReadingRecords, before it gets the page ready.

You cannot summarize a formula that has WhilePrintingRecords in it (or refers to a formula that has WhilePrintingRecords in it) because that happens after summaries are caclulated. Summaries only happen once - it doesn't go back to redo them.

If you can't change the timing of the formulas to WhileReadingRecords then your in trouble - you won't be able to sum it up.

To see what I mean. Create a formula called Test:
WhileReadingRecords; 1+1
You can sum this up.

Now try
WhilePrintingRecords; 1+1
You can't sum this up.

There's I think is the problem.

Hope this helps

G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top