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!

My report is not doing the right calculation in some records 1

Status
Not open for further replies.

aldi

IS-IT--Management
May 10, 2002
421
CA
Hello all,

I'm running CR10 on xp pro connecting to business vision (pervasive sql 2000i).

My problem is that some records are not calculated properly, and it is a simple calculation: qty * price.

example: qty = 797; price = 4.35
797 * 4.35 = 3,466.95 but I get 2,740.50

Honestly, I don't know how to tackle this.

Is there a way to troubleshoot this?
Is there anything like step into or watches in CR like visual basic?

I would inmensily apreciate your help!

Thanks in advance!

Aldi
 
Please post your formula, also what section is it in?

Do you have any conditionally suppressed records?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
dgillz, thanks for the reply.....apologies for the delay...

I found the problem but don't know how to fix it.
The problem is that the BVCMTDQTY field is summarized, and the formula @Value has the database field, and not the summary of the field BVCMTDQTY.

How can I add a summary to a formula used in the group footer?

The formulas are in a group footer section same as the summary for BVCMTDQTY field

@Value
{@UnitPrice} * {SALES_HISTORY_DETAIL.BVCMTDQTY}

I guess the @Value formula should be:
{@UnitPrice} * Sum({SALES_HISTORY_DETAIL.BVCMTDQTY}), which I tried, but give me the error:
"A summary has been specified in a non-recurring field"

@UnitPrice
// if user selected "All currencies in base" and the current record is not already in base
// we have to convert it using to rate and method given
if {?BV99SY11MulticurOn} and {?BV99MC01AllBaseForeignOrOne} = "All Currencies in base" and
{SALES_HISTORY_HEADER.BVCURRCODE} <> {?BV99SY12BaseCode} then
if {SALES_HISTORY_HEADER.BVCURRRATEMTHD} = "/" then
{SALES_HISTORY_DETAIL.BVUNITPRICE} * ({SALES_HISTORY_HEADER.BVCURRRATEAMT})
else
if {SALES_HISTORY_HEADER.BVCURRRATEMTHD} = "*" then
{SALES_HISTORY_DETAIL.BVUNITPRICE} / ({SALES_HISTORY_HEADER.BVCURRRATEAMT})
else
{SALES_HISTORY_DETAIL.BVUNITPRICE}
else
{SALES_HISTORY_DETAIL.BVUNITPRICE}


 
Try placing the earlier version of {@Value}:

{@UnitPrice} * {SALES_HISTORY_DETAIL.BVCMTDQTY}

...in the detail section and then right click on it and insert a sum at the group level. Then let us know if you are getting the correct value.

-LB
 
Mr. LB It works like a charm!.....albeit don't understand how it works.

Thank you so much......
 
The formula just multiplies the unit price times the quantity for each detail row. Then the summary adds all the results.

-LB
 
Mr. LB, thank you for the explanation!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top