do not Show similar data

Hello, I want to design a report which shows a related email-address for each contact if available. My problem hereby is, that in the table of contact communication data there are existing 3 fields: The first field “Contact No.” is the relation to my contact table, one field called “Number” can take values like “0023456/42453” or “example-mail@internet.com” – the other field called “type” specifies, whether “NUMBER” is a telephone number, mobile number, telephone no. private, e-mail-address private, e-mail-address, FAX No., etc. So for example, a contact can have a phone number, fax number and mail-address, - or just a mail address or just a phone number.

I want to show a few contact dates (like address, shoe size, favourite colour, etc.) and the related “NUMBER” (email-address) if available. If there is no related mail-address, this field should stay empty.

Before



Contact No



Contact Name



Shoe Size



Favourite colour



NUMBER



TYPE



001



John Doe



45



purple



0011223344



Phone No



001



John Doe



45



purple



0012345678



Fax No



001



John Doe



45



purple



example@internet.com



E-Mail



002



Jane Roe



38



green



0099887766



Phone No



002



Jane Roe



38



green



0098765432



Fax No



002



Jane Roe



38



green



placeholder@worldwideweb.de



E-Mail



003



Sarah Parker



39



yellow











004



John Wayne



44



blue



0022556688



Phone No.



004



John Wayne



44



blue



wayne@web.com



E-Mail

So I put =IIF(Fields!Type.Value = “E-Mail”, False, True) in the hidden/visibility properties in the field “NUMBER” in Visual Studio Report Designer

My result (at the moment)



Contact No



Contact Name



Shoe Size



Favourite colour



NUMBER



TYPE



001



John Doe



45



purple







Phone No



001



John Doe



45



purple







Fax No



001



John Doe



45



purple



example@internet.com



E-Mail



002



Jane Roe



38



green







Phone No



002



Jane Roe



38



green







Fax No



002



Jane Roe



38



green



placeholder@worldwideweb.com



E-Mail



003



Sarah Parker



39



yellow











004



John Wayne



44



blue



wayne@web.com



E-Mail

My desired result



Contact No



Contact Name



Shoe Size



Favourite colour



NUMBER



001



John Doe



45



purple



example@internet.com



002



Jane Roe



38



green



placeholder@worldwideweb.com



003



Sarah Parker



39



yellow







004



John Wayne



44



blue



wayne@web.com

My Dataset



Expanded



Data Type



Data Source



Name



Include Caption



1



DataItem



Contact







No



0



Column



Name



Name



Yes



0



Column



Phone No.



PhoneNo



Yes



0



Column



Company Name



CompanyName



Yes



0



Column



E-Mail



EMail



Yes



0



Column



Post Code



PostCode



Yes



0



Column



City



City



Yes



0



Column



Salutation Code



SalutationCode



Yes



0



Column



Address 2



Address2



Yes



0



Column



E-Mail 2



EMail2



Yes



1



DataItem



Contact Communication Data







No



0



Column



Number



Number



Yes



0



Column



Type



Type



Yes

func.PNG

It would be glad if you can help me in this case.

Hi Kadi,
what I understood is you just needed only two types of contacts 1. with Email addrs 2. None.
Then SetFilter in Onpredataitem of Contact like below So that only those values only visible …

Contact - OnPreDataItem()
Contact.SETFILTER(Contact.Type,‘Email|’ ‘’);

Let me Know if You need Any Help

Thank you very much Raja,

I couldn’t filter on empty string, because my field is an option.

But this helped me:

“Contact Communication Data”.SETFILTER(“Contact Communication Data”.Type,’<>Phone No. private&<>Phone No.&<>Mobile Phone No.&<>E-Mail&<>Fax No.&<>Fax No. private&<>Mobile Phone No. private’);

so I just excluded every option instead of “E-Mail private” - it doesn’t look very proper but it works.