Solved

Duplicates in Address Label Crystal Report

Posted on 2004-10-05
5
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

617 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