Print Page | Close Window

Address contact not showing

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11509
Printed Date: 28 Apr 2024 at 5:56pm


Topic: Address contact not showing
Posted By: mgreen
Subject: Address contact not showing
Date Posted: 25 Oct 2010 at 5:34am
Good Morning,
 
  I have just tried using Crystal reports for the first time and I am importing a database into crystal reports inorder to use that information in my report.   Well I have gotten my report setup and it pulls in all my contact and address information fine. But when I go to preview the report it will not show up a contact if they do not have a phone number.  How do I get it to show contacts regardless of a phone number being there or not.
 
Thank you for your time,
 Michael
 
I am using Crytsal Reports Version 11



Replies:
Posted By: DBlank
Date Posted: 25 Oct 2010 at 6:00am
did you write a formula combining fields into a single string?


Posted By: mgreen
Date Posted: 25 Oct 2010 at 6:03am
I don't think so, I have just pulled the fields over from the field explorer and put them in the detail section of a blank report. Do I need to creat a formula?
 
Have a great day,
 Michael


Posted By: DBlank
Date Posted: 25 Oct 2010 at 6:14am
No you don't have to but if you were and there were NULL values in the phone it would explain the behavior.
are you using more than one table adn if so are you doing outer joins?
If you are doing outer joins are you using a select statement?


Posted By: mgreen
Date Posted: 25 Oct 2010 at 6:25am
- I think I am only using 1 table. 
- There are NULL values because some contacts have never had phone numbers.
- I'm not sure if I am using select statements. I just clicked and dragged the fields over.
 
Thank you for the help so far.
 


Posted By: DBlank
Date Posted: 25 Oct 2010 at 6:32am
Go into Database Menu and select Databse Expert.
How many tables are in the 'Selected tables' window?
If there are more than 1 go into the Links tab of that window.
double click on the joni line and see what the join type is.
If it is an inner join you need to make it an outer join. Left or Right depends on whcih way the tables are set to.


Posted By: mgreen
Date Posted: 25 Oct 2010 at 8:18am
Ok I looked and there is only 1 database in that window.


Posted By: DBlank
Date Posted: 25 Oct 2010 at 8:29am
1 DB or 1 table? I'll assume 1 table but just want to make sure.
This is odd...
 
If you remove the phone# field from your report all the records show up, but if you drag and drop the phone # field onto the detail section records start to disappear.
is that a correct description?


Posted By: mgreen
Date Posted: 25 Oct 2010 at 8:39am
Yes that is correct about the description of the problem.  I think what is happening is that when Crystal Reports sees that there isn't a phone number it just doesn't print that entire contact (ie. Name and address)
 
I think it is a DB. the top of the tree is Field explorer says "Database Fields"
 
 


Posted By: DBlank
Date Posted: 25 Oct 2010 at 8:46am
I am almost positive you have at least 2 tables in this report. They will be from the same DB.
Likely you have a CONTACTS table and a PHONE table which are joined togther as an inner join on the CONTACT ID field.
IN your Field explorer (top of your tree), expand the Database Fields.
Now you should see 2 or more table names (CONTACTS and PHONES). If you expand the table names you will see the fields/columns in each table.
 
Here is what I am pretty sure is happening.
Crystal does not enforce joins just by making the join (like in SQL). You have to tell it to be enforced in the join set up or it will enforce the join when you use fields from both tables anywhere in the report. So when you exlude the phone number all the contact names appear. As soon as you use the phone number the join is enforced and the names disappear becase ther eis no row in the PHONE table to match to any row in the CONTACTS table.
Is this more on track?


Posted By: mgreen
Date Posted: 25 Oct 2010 at 9:00am
Ok I see now, yes i have multiple tables, so once I have the phone table expanded in the tree it gives me these three things in the tree : IDKEY, Phone_Number and LINK.  What do I click to change the join?


Posted By: DBlank
Date Posted: 25 Oct 2010 at 9:06am
go to Database Menu at teh top of Crystal
select DB Expert
click on the LINKS tab
You will see your tables and lines drawn beteen them.
THis is the diagram of how your tables are joined (and on what fields)
double click on the line joining your PHONE and CONTACTS tables
A box opens
on the lef tis  ajoin type
at the top of the link options it describes the join
if CONTACTS is listed first use a left outer join
if PHONES is listed first use a RIGHT outer join
Yo can also "enforce" in here but it is redundant to enforcing when you use the fields in the report itself.
Link type should remain as "="
Go back into your report and test it out.
If you are still missing data reverse the join type ...if you picked LEFT swithc to right, etc.
 
 


Posted By: DBlank
Date Posted: 25 Oct 2010 at 9:07am
if you have more than these 2 tables you may need to change your other joins as well.


Posted By: mgreen
Date Posted: 26 Oct 2010 at 4:50am

That was it!!! I changed them to a left outer join and the rest of my contacts showed up!

 
Thank you for your help!!!



Print Page | Close Window