Solved

crystal report if statement

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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. …
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 …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 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