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 100

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 100

Expert Comment

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


Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Grand Totals on Crystal Reports 7 52
Crystal Reports Format Field with Dashes 6 61
Crystal Reports Subreport details 16 79
Crystal Reports 13 5 87
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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