crystal report if statement

Posted on 2003-11-11
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};
Question by:jessica00
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
LVL 13

Accepted Solution

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

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

Expert Comment

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

Is CAN GROW set?

Format the field


Author Comment

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

Expert Comment

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


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