Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Duplicates in Address Label Crystal Report

Posted on 2004-10-05
5
Medium Priority
?
301 Views
Last Modified: 2008-02-01
I have a crystal report that is using ODBC to link a number of tables.

The report itself is an 'address label' style report, so the data that gets pulled back MUST go in the details section of the report and NOT a group (othwerwise I wouldn't be asking this question) ie. The group section does not have a 'layout' tab which would enable me to replicate the address label etc

The table structure is as follows (TABLE - Columns):

CONTACT
ID, Prefix, First_Name, Last_Name

LIST
ContactId, List_Name

(There are other tables but these are not causing the dupes)
-----------------

One contact can belong to many lists. At runtime, the user is prompted to select one or more lists. If they select two or more lists that the contact is a member of, the contact is returned multiple times in the details section.

Unfortunately, Crystal places the List_Name column in the SQL Query even though it is not output on the report itself, as it is a parameter.

Is there any way of removing that column from the SQL query?

I cannot write a view or sproc to replace the report as they can select n number of lists when the report is run.

HELP!
0
Comment
Question by:Optevia
  • 3
  • 2
5 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 12226724
Is your question about how to eliminate the duplicates?  If so, I would sort the records by the contact ID and then simply suppress the details section whenever it repeats.  Basically a conditional suppression formula of:

  ({contact.id} = previous({contact.id}))

frodoman
0
 
LVL 2

Author Comment

by:Optevia
ID: 12226889
When I try to add your line to my RECORD SELECTION formula I get an error:

" The Function cannot be used because it must be evaluated later "

Here is the rest of my formula:

{lists.listname} = {?List} and
(if {?Party} = 88 then true
else if {?Party} = 99 and isnull({contact.affiliation}) then true
else false) and
{contact.gender} = {?Gender} and

({contact.id} <> previous(contact.id))
0
 
LVL 42

Accepted Solution

by:
frodoman earned 2000 total points
ID: 12226960
This doesn't go into record selection, it needs to go into conditional suppression.

Report -> Section Expert.  Click "Details" then click the formula button (X+2) to the right of the word "Suppress".  Enter the formula I gave you in this section.

This will suppress the details whenever the contact id is equal to the previous contact id.  It doesn't prevent the record from being read into Crystal but will prevent it from being visible or printed.

Again though, this is only effective if you're sorting by the contact id to insure that duplicates are next to each other.  If the duplicates aren't adjacent then they won't be suppressed.

HTH

frodoman
0
 
LVL 2

Author Comment

by:Optevia
ID: 12227029
Thanks frodoman...
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12227072
Glad to help - frodoman
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Loops Section Overview
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question