Solved

Custom Function Integer to Text String

Posted on 2013-05-29
4
404 Views
Last Modified: 2013-05-29
Hi All,

I have a report I am generating in Crystal Reports from Sql. One of the table columns returns the values 1, 2, 3, and 4 where 1=Major, 2=Minor, 3=Unassigned, and 4=Error

How do I convert the returned values in the column to the text values associated with them? Can someone please show me what the string/function would look like?

Thanks!
0
Comment
Question by:Drud1981
  • 3
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39206036
Try

Local StringVar Array  DispString := ["Major", "Minor", "Unassigned", "Error"];
DispString[{YourFIeld}]

Open in new window


mlmcc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39206041
You can also use if-then or case logic

If {YourField} = 1 then
    "Major"
Else If {YourField} = 1 then
    "Minor"
Else If {YourField} = 1 then
    "Unassigned"
Else
    "Error"

Open in new window


mlmcc
0
 

Author Closing Comment

by:Drud1981
ID: 39206071
Thank you! The first answer gave me an error that highlighted the first comma and told me the ) was missing.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39206097
I just tried it and I don't get an error.

Good thing I added the other one

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sub Report Graphs In Main Report. 36 47
Conditional Text in Crystal 4 44
Selection between two dates and time range. 21 25
A string is required here error 20 8
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now