Solved

Duplicates in Address Label Crystal Report

Posted on 2004-10-05
5
293 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
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
Thanks frodoman...
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
Glad to help - frodoman
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now