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

Crystal Reports Rounding Problem

Status
Not open for further replies.

techie2

Programmer
Jul 28, 2004
180
US
Hi,

Using CR 8.5 / CE 8.5 and Oracle 8i. Using Native connections to Oracle.

Here is the base data
Grp1 989942.59 989943 (On Rounding)
701263.61 701264 (On ROunding)
Grp2 1691206.20 1691206 (On Rounding)
(Grp2 is the sum of values in Gr1)

Grp1 is range of accunts from 1 - 1000 and
Grp2 is range of accounts from 1001 - 2000

Grp1 and Grp2 summation formulas use base dollar amount.

What I want is when Grp1 and Grp2 rounds off to values 989943 and 701264; I want to display the sum of these dollar amounts after roundings, which should be 1691207 and NOT 1691206.

For both Grp1 and Grp2, I am using the same formula, which is DebitAmount + CreditAmount.

Please let me know if you need any more info.

Any help on this is appreciated.

V
 
Create a formula of:

Round({TABLE.Debit}-{TABLE.Credit})

Now base your aggregate formulas (sums) on this formula.

-k
 
Thanks for the post.

If I use round({TABLE.Debit}+{TABLE.Credit}) in my original formula, which is the base formula for both Grp1 and Grp2, results are same and I dont get desired output.

This is what I get after using your suggestion:
Grp1 989943 (This if fine after rounding)
701264 (This is fine too after rounding)
Grp2 1691206 (This value, I want the sum of Grp1 totals)

When I use rounding at base formula, it calculates 989942.59 + 701263.61 = 1691206.20 and then rounds to 1691206 and NOT 1691207 which is the output I want.

Again, both totals in Grp1 and Grp2 use the same formula.

Any more suggestions.

Thanks,

V
 
Try:

round({table.debitamt}) + round({table.creditamt})

-LB
 
Round the summary results in each group, then summarize the rounded group results with a variable.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Thanks again for replies.

LB: If I round the base dollar amount, then I am not calculating the dollar amount correctly. Cents in the dollar amount needs to be added and only total at group level needs to be rounded.

dgillz: As I said Grp1 and Grp2 totals comes from same formula. How can I use the variable to grab values from Grp1 group to be displayed in Grp2. I am thinking, this approach might work. Can you provide little more detail based on my example data above.

Any more suggestions guys. I really appreciate your replies.
 
Oops, I misread your post and ignored that these were already group summaries. To get the report level summary (or summary at a higher group level), use two formulas:

//{@accum} to be added to the group header or footer:
whileprintingrecords;
numbervar grpsum := grpsum + round({table.amt},{table.group});

//{@displ} to be placed in the report footer (or in a an outer group footer):
whileprintingrecords;
numbervar grpsum;

If you are aiming for a summary at a higher order group level, then you will also need a reset formula:

//{@reset} to be placed in the higher order group header:
whileprintingrecords;
numbervar grpsum := 0;

-LB
 
Thanks LB. I will try it on Monday and let you know how that logic goes.
 
Sorry Guys, Was in the training...could not reply earlier.

Thanks dgillz and LB for pointing to right direction.

Using variables in the formulas, I am able to achieve the results.

Thanks Again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top