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

Wrong result when the "Detail" part is suppressed 3

Status
Not open for further replies.

ching0418

MIS
Mar 6, 2002
96
HK
I have a report which needs to output a sum of the transactions per item. I need not display the list of the transactions, just the sum. But if i'll suppress the "detail" part, i get a wrong result. Can somebody explain why?

thanks in advance!
 
No problem.
You are probably accumulating values once per record when you really want to accumulate values once per group.

Use runing totals rather than regular totals and adjust the accumulation rules. For example, if you were working with salesmen, customers and invoices (one salesman has many customers, one customer can have many invoices) and you wanted to show gross sales per salesman, and gross sales was a field in the customer table, but for some reason you also had to link to the invoices table), you would group on the following:

1 - salesman
2- customer

The running total would accumulate once per group 2 and reset on each group 1. Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
Yes, i'm using the running total field. I have an ITEM group and per item are multiple sales transactions (Detail). Then i have a running total of the total sales per item(Group Footer). If i'll display all the transactions, the total is okay. But i need not display the transactions, i just need to show the total sales per item. So, what i did is to suppress the detail. It is when i suppress the detail part when i get a different result for my total sales per item. I can't find the reason why. Please help.

Thanks! [lipstick]
 
Record suppression does not keep the records from evaluating in any group totals or grand totals on your report. There are 3 options:

1) Use a record selection formula to exclude the records from the report

2) Use running total fileds

3) Use variables

There is a very good FAQ on using variables, see the FAQ section for details. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
Are you using a running total formula with variables or a running total field?

If a formula post it here.
If a RT Field, post the settings used. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
While you are using a running total, I bet you have not
adjust the 'accmulation' option. It is probably accumulating once per record. You need to accumulate once per group. Select your 'lowest' group (that is the group with the highest number).

that should work. Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
i'm using a running total field.

the settings i made are:

- Evaluate for each record
- Reset on change of group (that is item group)

I'm just wondering why the result is different when suppressed, and not on all records, just some of them. Please help i'm really stucked on this.

Thanks again!
 
DO NOT use supression, it WILL NOT keep your records from evalauting in formulas. You have 2 choices:

1)Use a record selection formula to exclude those records from the report, using logic youare already employing to suppress these records.

2) Change from evaluate on each record to evaluate based on formula, and input logic that you are already using to suppress the unseen records.

I highly recommend option #1

Please post again if you have any questions. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
Is it higher or lower with details suppressed? It shouldn't be either. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Actually, I think I know what the problem could be. There is only ONE feature of CR that retrieves different records based on whether the details are suppressed or not. Do you have the setting "Perform Grouping on Server" turned on? If you do, suppressing details will change the SQL statement and only retrieve summary records.

Go to:

File - Report Options

in this report to shut this off. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
ken:
i've checked the "Perform Grouping on Server" option, it's turned off

dgillz:
I tried you're suggestion, instead of inserting the other fields in the detail part and suppress it, i used formula then emptied the detail part, so nothing is in there so i don't have to suppress that part anymore. I need to move that part so no spaces will be displayed, but then i still have the same problem, but if i'll put some space, the result is ok. I have one observation, there's a discrepancy with the result when it's the first record of the page, but the rest of the page is ok.

thanks!
 
Only the top of the page? That is a different problem.
Are you using version 7 by any chance?
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Version 7 has some bugs with running totals that sometimes crop up when you use the group options:
'keep group together' or
'repeat group header on each new group'.

Go into your change group expert and shut these settings off for all groups and see if that has an effect. This should not be directly related to the suppressed details, but it might be more noticeable when the details are suppressed. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
The 'keep group together' and 'repeat group header on each new group' options are turned off. I turned on the 'keep group together' option and the result is now ok. ????
Does it have something to do with that option? Or is it the bug of crystal 7 you mentioned that caused this problem? I hope it really solved my problem.

Anyways, thanks a lot for all the solutions that you guys gave! Thanks howard, dgillz and ken.
 
Yes, this is the bug that I was referring to. I thought it was the other way around, but my memory may be failing me. There was a maintenance release for v7 but I am not sure if it fixed this bug. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top