Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Changing value in a field Post Reply Post New Topic
Author Message
sunchaser
Newbie
Newbie
Avatar

Joined: 11 Nov 2009
Location: United States
Online Status: Offline
Posts: 5
Quote sunchaser Replybullet Topic: Changing value in a field
     Posted: 11 Nov 2009 at 7:49am
Hi,

I am new with Crystal Reports.  Let me tell you about the problem.

We are using Crystal Reports with Salesforce.  I have a report with 3 columns.

Contact.Name  Contact.TotalAmount and  Contact.OwnerID fields. 

What I want to do is, to make Crystal Reports connect to SalesForce database and use OwnerID field to access the owner's contact.name field and display that in the report. 

Is that possible?

I would really appreciate any thoughts about it.

Thanks.


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Nov 2009 at 7:56am
likley you are already connected to that Database and you just ned to add the table that stores the "owner's contactname" field and link it. Then it can be added to the report.
Go to the Database menu and select Database Expert
You have to then make a connection to the datasource
from there you can add the table with the name.
Once that is done you go to the Links Tab and make the appropriate link to from one tbale to the other (likely an inner join on the Contact.OwnerID field).
IP IP Logged
sunchaser
Newbie
Newbie
Avatar

Joined: 11 Nov 2009
Location: United States
Online Status: Offline
Posts: 5
Quote sunchaser Replybullet Posted: 11 Nov 2009 at 8:53am
Thank you for your answer Dblank.

The problem is ,  Owner's name  should be queried from the same table (which contains all accounts)  the user is located.  So both user name and owner name should be queried from the same table.

Do you know a way to do it? Should I add a alias of the table and link it to ownerID?


Edited by sunchaser - 11 Nov 2009 at 9:00am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Nov 2009 at 9:00am

Sorry but having trouble visualizing this.

If the data is already being pulled in on a row you can just use it. If you need to re_use the same table and link on it again to get a different value you should be able to do this. I do it in SQL with no issues but I do not know what the Salesforce DB type is so can't say for sure you can do it. When you add the same table twice (or more) the second add just drops a "_1" on the end to differentiate it. YOu should end up with an "contact" and a  "contact_1".
Does that help?
IP IP Logged
sunchaser
Newbie
Newbie
Avatar

Joined: 11 Nov 2009
Location: United States
Online Status: Offline
Posts: 5
Quote sunchaser Replybullet Posted: 11 Nov 2009 at 9:23am

Sorry, the way I told about it, was a little bit complicated. Let me try to describe it better.

The table is called Contact.

It has ID , Name and OwnerID columns along with bunch of others.

I used a formula to retrieve specific records and print the "Name" from the table.  But I also would like to print the Owner name as well. But what I have in the table is only the "ownerID" field. Which is basicly an "ID" number.   I am trying to retrieve and print the name associated with this 'ownerID' but seems like it is not very easy to do (at least with my current CR knowledge).


As you said it will be much easier to do with SQL , but unfortunately  Salesforce  does not allow me to use SQL expressions. 

I tried the "contact" and "contact_1" tables but CR froze when I tried that.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Nov 2009 at 9:24am
Are you writing a command for your source?
IP IP Logged
sunchaser
Newbie
Newbie
Avatar

Joined: 11 Nov 2009
Location: United States
Online Status: Offline
Posts: 5
Quote sunchaser Replybullet Posted: 11 Nov 2009 at 10:33am
You mean Salesforce? no, it is natively supported in CR as a data source.


Edited by sunchaser - 11 Nov 2009 at 10:34am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Nov 2009 at 11:19am

I meant are you using a COmmand option in the add datasource instead of just adding the table directly. Sometimes people choose to bypass the GUI add tables and write a SQL Command to get the Data into the report. Usually when they are trying to do more complex joins...

So when you open up the Database Expert you have a Datasource on the left and your tables on the right and when you went to add in the Contact table (labels it Contact_1) it froze?
Make sure when you add the contact table you go to the links table and fix the links before closing the DB Expert. It will likely make all kinds of odd links because it can link back the other contact table on every field(originally in the report) and the other tables in there. With all those joins it might loop the data and freak it out. Or if you have auto join turned off it will make no joins which can have the same effect.
Does this help?


Edited by DBlank - 11 Nov 2009 at 11:22am
IP IP Logged
sunchaser
Newbie
Newbie
Avatar

Joined: 11 Nov 2009
Location: United States
Online Status: Offline
Posts: 5
Quote sunchaser Replybullet Posted: 11 Nov 2009 at 12:57pm
Oh I see. No I didn't use command option. But if that is an option I can use with this db, I'll try to use that as well.

I noticed about the excessive links when I had tried to use DB Expert before. I cleared and re-linked the data but it still didn't work unfortunately.  Maybe the problem is still something related with the links, I'll try other combinations.

IP IP Logged
RogDodge
Newbie
Newbie


Joined: 09 Sep 2009
Online Status: Offline
Posts: 3
Quote RogDodge Replybullet Posted: 13 Nov 2009 at 2:58pm
I had some a somewhat similar problem when I first started using CR.  I had way to many links and for CR was not pulling any data what so ever.  I went down to one common ID between all the tables, in my case it was (Client.ID) and I started to get my reports working. 
 
I noticed that you said that you got rid of all the excessive links, but did u try and bring them all down to 1 link per table? 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum