Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Lookup description for coded value Post Reply Post New Topic
Author Message
valerieb
Newbie
Newbie


Joined: 06 Feb 2009
Location: United States
Online Status: Offline
Posts: 8
Quote valerieb Replybullet Topic: Lookup description for coded value
    Posted: 06 Feb 2009 at 11:09am
Hello Everyone -
I am new to Crystal Reports, so forgive me for my very basic question...
I am writing a report that requires many of the values to be "looked up" against another table, (eg status 1 should be displayed as "completed").
At first I started adding these additional tables into the data/links section, but this is getting unmanagable... there must be a better way!
I would prefer to just do a select statement to get my lookup but I understand i can not do this in a SQL expression.
I can build a function in SQL Plus to do my lookup, but i am unable to see the function from within Crystal Reports. 
Do i need to put the function into a package for Crystal to see it?  Can i access a stored function or only a stored procedure? 
Please help!!!  I have seen some reference to people saying they do this type of thing in a custom function.  Could you please provide some sample code of what does in the function?
Thank you thank you thank you!
Val
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 06 Feb 2009 at 11:29am
Can you write your own SQL statement to retrieve all your data including your lookups ?  If so, you can put that SQL statement in your Crystal Report.  To get more info on how to do this, go to the help screen and search for 'Define a SQL command'.    I have done this a few times and it works great.  It might work for you.
IP IP Logged
valerieb
Newbie
Newbie


Joined: 06 Feb 2009
Location: United States
Online Status: Offline
Posts: 8
Quote valerieb Replybullet Posted: 06 Feb 2009 at 11:35am
Thank you for your quick response!
I could do that for some cases, but it will get overly complex to add them into one massive sql statement.   
One of the things i need to do is to lookup dynamic field labels, so for each field from the database, i need to do a lookup for both the label (based on the column name), and in most cases for the value ("complete" instead of "1") to display.
Is there a way to isolate these queries?
Thanks
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.