Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to get value from field with multi Post Reply Post New Topic
Author Message
karko
Newbie
Newbie


Joined: 05 Jul 2010
Location: Poland
Online Status: Offline
Posts: 5
Quote karko Replybullet Topic: How to get value from field with multi
     Posted: 14 Jan 2011 at 11:22pm
Hi all,

Hope you're having a good weekend.

I have small issue with CR10. This is the situation:
- I have one table named CONTACT_ROLE - inside we have a list of employee roles for example: Business Owner, Service Owner, Approver etc.;
- I am creating my own fields to show last name and first name for each role;
 
To get the last name and first name I use the following code:

global stringVar BO;

if {CONTACT_ROLE} = "Business Owner" then
BO := {CONTACT_FIRST} + " " + {CONTACT_LAST}

else if {CONTACT_ROLE} = "Service Owner" then
SO := {.CONTACT_FIRST} + " " + {CONTACT_LAST}


And my own BUSINESS_OWNER field:
EvaluateAfter ({@CHOOSER});
global stringVar BO;
BO


This code will return me each employee name. And it works fine.

PROBLEM: Sometime I have 2 and more people assigned to one role. For example I have 3 Business Owners. How can I access those other names?
Is there a way to look up through whole table? May I use any kind of pointer I may use? Please help!
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 17 Jan 2011 at 4:12am
You said in some cases you have 3 business owners.  That would mean you have 3 database records where the contact_role is "business owner".  What is your select statement ?  Can you process each record in the database and sort them by contact role so that all business owners are grouped together ? 
IP IP Logged
karko
Newbie
Newbie


Joined: 05 Jul 2010
Location: Poland
Online Status: Offline
Posts: 5
Quote karko Replybullet Posted: 19 Jan 2011 at 3:35am
Hi John,

Its a bit tricky to explain. I have few Business Owners in one record. I would need to search through record to find if there exists another BO and if yes then return his name and last name. This is how it works. I need to have each role in different column for example:
BO1_COLUMN BO2_COLUMN BO_3COLUMN

I think that grouping would give sth like:
TICKET_ID BO1_ROW
                  BO2_ROW
                  BO3_ROW
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