if then else for report text

Options
In Crystal Reports 9 is it possible to hide or show a field label based on whether the field is empty or not? For example, depending on whether the constituent is an individual or an organization I want to print the membership category. I'm trying to avoid empty fields after the "Category:" label.
Tagged:

Comments

  • Try reading this forum post: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5278. Let me know if it worked!
  • Steven,

    What I do is  right click on the label and select Format Text, then click the Suppress button, then click on the formul editor button to the right of that. In the fomula editor I have the following:

     {whatever my field name is} = ' ' or isnull({whatever my field name is}}



    I hope that helps.

     
  • Paula Alionyte:

    Try reading this forum post: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5278. Let me know if it worked!

    Paula,



    Thanks for the link, I'll let you know how it turns out.



    Steven
  • Marie Stark:

    Steven,

    What I do is  right click on the label and select Format Text, then click the Suppress button, then click on the formul editor button to the right of that. In the fomula editor I have the following:

     {whatever my field name is} = ' ' or isnull({whatever my field name is}}



    I hope that helps.

     

    Marie,



    Fantastic. This works for one of the fields, however, the other is a date field and the formula editor requires a date not a blank. These records won't have membership expiration dates. Is there a similar expression I can use to test them?



    Steven
  • Steven,

    You could try just saying isnull({whatever date}).

    If that doesn;t work please let me know. I think I have another formula to convert the date to text.
  • Marie,



    I had a chance to give it a little more thought and the same suppression criteria is valid for both.

    Thanks for your help with this.



    Steven

Categories