Solved

crystal report if statement

Posted on 2003-11-11
4
341 Views
Last Modified: 2006-11-17
I've got the following statement, but nothing comes out:

Local stringvar sResult := "";

If Length({TB1.FLD1}) > 0 then
    sResult := {TB1.FLD1} & Chr(13);

If Length({TB1.FLD1}) > 0 then
    sResult := sResult & {TB1.FLD2} & Chr(13);

If Length({TB1.FLD3}) > 0 then
    sResult := sResult & {TB1.FLD3} & Chr(13);

sResult := sResult & {TB1.FLD4} & " " & {TB1.FLD5} & " "& {TB1.FLD6};
sResult
0
Comment
Question by:jessica00
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
EwaldL earned 245 total points
ID: 9726995
could it be that one of the fields has a null value? if so, have a look at this
http://support.crystaldecisions.com/library/kbase/articles/c2000247.asp

Or try try setting "Convert null values to default" in the report options.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9727370
Is the field on the report tall enough to handle the field?

Is CAN GROW set?

Format the field
Check CAN GROW

mlmcc
0
 

Author Comment

by:jessica00
ID: 9727426
IsNull works perfect, I won't use Length() in this case any more
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9736311
For future reference a NULL doesn't have a length so the value is not defined.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 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

22 Experts available now in Live!

Get 1:1 Help Now