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!

Summary of a formula

Status
Not open for further replies.

mke1981

IS-IT--Management
Oct 6, 2010
4
GB
Hi All,

I have a crystal 11 report that passes a value (as a number) to a sub report.
in the sub report i have then created a formula(@KG) that uses this value to make a calculation
EG
the value passed is 100 (called "@blends") this is then
multiplied by a field on my report called QtyPer. (5)

this is working fine, but i now wish to summarize this field but its not letting me.

I have checked that all fields are numbers (which they are)
i beleave this may have something to do with the second-pass.

Could someone please help me sum this formula?
 
You can only do a summary on a field if it is derived from a single detail line. Is that the problem?

You say the formula is in a subreport. Are you also trying to summarise it in the subreport?

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Hi thanks for your very quick responce,
the summarise is on the sub report.

however the @blends field i have just placed in the header of the sub report and suppressed this.

i will want to pass this summary back to the main report
 
Create a formula for the section containing {@KG} in the sub:

whileprintingrecords;
shared numbervar blends; //your value from the main report
shared numbervar sumbl := sumbl + (blends*{table.qtyper});

In the sub footer, add this formula:

whileprintingrecords;
shared numbervar sumbl;

In your main report, in a section below the one containing the sub, you can now reference the summary using the same formula as in the sub footer.

-LB
 
Sorry i dont understand, do you mean replace my formula for @KG with

Whileprintingrecords;shared numbervar blends; //your value from the main reportshared numbervar sumbl := sumbl + (blends*{table.qtyper});
 
Please show the content of your formulas {@blends} (which contains the variable from the main report and which I called in my formulas "numbervar blends" and {@KG}--which I eliminated by building the calculation you described into my summing variable.

In the future, it is best to show the actual content of your formulas rather than describing them. Then the responder can build upon what you have already done--and with less confusion.

-LB
 
Hi thanks for your advice,

the formula for @blends is
Shared numbervar NAME; (which has been passed from the main
report)

and the formula for @KG is
{BomStructure.QtyPer} * {@blend}

all i am trying to do is sum the @KG and pass that value to
the main report.

thanks again for your help
 
Here's a different way to the same thing. Place this formula in the section containing {@KG}:

evaluateafter({@KG});
whileprintingrecords;
shared numbervar sumbl := sumbl + {@KG};

In the sub footer, add this formula:

whileprintingrecords;
shared numbervar sumbl;

Then you can use this last formula in the main report, too, to show the value--in a section AFTER the one containing the subreport.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top