Print Page | Close Window

How to omit a type of string

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21348
Printed Date: 28 Apr 2024 at 10:01am


Topic: How to omit a type of string
Posted By: korigirl
Subject: How to omit a type of string
Date Posted: 24 Feb 2015 at 8:40am
Newbie here, sorry!

I have a database where one field (Participant Phone Number) produces three outputs: Home, Cellular, E-mail (but it actually displays the number or address). There's another field (Participant Phone Type) that tells me which of those three it is.

In my Crystal Report, I only want to display the Home or Cellular and omit the E-mail altogether.

I played around with If/Then statements but could not produce what I wanted.

I also tried suppressing the E-mail "Participant Phone Type", but it doesn't remove the entire line of data, it just leaves that field blank.

Any tips?



Replies:
Posted By: korigirl
Date Posted: 24 Feb 2015 at 8:46am
As a follow up, in my mind, this is what I think I need:

If Phone Type = Home or Cellular, Then Display Participant Phone Number, Else Don't display that row [there are other fields on that row]

I'm just not versed in Crystal speak enough to figure out how to produce that


Posted By: DBlank
Date Posted: 24 Feb 2015 at 10:16am
if you use the select expert you can omit the rows from the report
the select expert expects a True/False evaluation of each row.
True keeps the row, False excludes the row.
example:
{table.phonetype} in ["Home","Cellular"]


Posted By: korigirl
Date Posted: 24 Feb 2015 at 10:40am
@DBlank, thank you. I just figured out another way, although I'm not sure if it would work every time.

I ended up displaying the Participant Phone Type, used the Select Expert to choose only Home or Cellular, then used Display string to show the Participant Phone Number.

It worked exactly how I need it to. I would delete this thread but might as well leave it up for anyone else to see if they have a similar issue.

Thanks again!



Print Page | Close Window