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

Eliminate repeating Detail Lines AND Amounts

Status
Not open for further replies.

flager

Technical User
Jan 10, 2002
6
US
I have a problem with repeating detail lines. I have tried creating a group and then comparing the group to the previous group. When equal it seems to eliminate the second detail line from printing. But it seems to retain the values and amounts and continues to add them into the total. The group I created is ‘@DuplicateRule’. It is composed of 4 fields from the report, that when equal – the printing of the detail line should be suppressed. I have suppressed the detail line in the Section area and included the formula with the button option utilizing



1.)WhilePrintingRecords;
Previous ({@DuplicateRule}) = {@DuplicateRule}

2.)If Previous({@DuplicateRule}) = {@DuplicateRule}
then True
Else
False

In both cases, the unwanted detail lines are eliminated, but the amounts from those lines continue to be added to the subsequent subtotal and total fields. Also, utilizing either of the above formulas for suppression of the detail line, additionally deletes some lines that are not equal on at least one of the 4 fields previously alluded to. What do I do? I am utilizing Crystal Reports ver. 8.5.
 
Create a Running Total and set its Evaluate expression to
whatever condition you wish. You could create a formula retuning a concatanation of all four fields, and set the Evaluate option of the Running Total to "on change of.."
that formula.

Cheers,
- Ido ixm7@psu.edu
 
Ido

Initially, I must admit that I am quite new (2 months) to the use of Crystal. But I have several fields that are accmulating values for each detail line within a group. (one of the four fields in the group that I created) When the group changes, the lines that have been suppressed still seem to be retained for the the subtotal of that group. The suppression (of the detail line when duplicates are encountered) seems to be working, but the values are retained. Should I creat running totals for each item to be subtotaled (how) and then Evaluate on what ? Some examples would be greatly appreciated. Thanks Fred
 
Your problem is that your totals are inflated by however many records you have in your many to one relationship, so create a running total field that evaluates on the change of the *key* field, rather than for every record. Go to insert, field object, running total field and it is very straightforward.

If you have more than one grouping in your report, you will have to have multiple running total fields or you will still experience inflation at the next group as well as grand total levels.

Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
the fundamental problem that you have is that you have unwanted detail lines...get rid of those and your sum problems will probably disappear.

I would expect you have a table linkage something like this



Table 1 Table 2
======= =======
Field 1 ----> Field 1
.
.
. Table 3
. =======
Field N -----> Field 1


Eg: the join from {Table1.Field 1} to {Table2.Field 1}
may bring back 2 records

and the join from {Table1.Field N} to {Table3.Field 1}
may bring back 2 records

Your result will be a report with 4 detail lines where you may only want 2

The solution to this is to create a subreport of table 2 or 3 and link it to the main report Table 1

I think you have to solve the problem of the unwanted detail lines before looking to solve the math

hope this helps....Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top