Solved

crystal report if statement

Posted on 2003-11-11
4
340 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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 …
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

23 Experts available now in Live!

Get 1:1 Help Now