Solved

crystal report if statement

Posted on 2003-11-11
4
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 101

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 101

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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