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 |
|
002 |
Jane Roe |
38 |
green |
0099887766 |
Phone No |
002 |
Jane Roe |
38 |
green |
0098765432 |
Fax No |
002 |
Jane Roe |
38 |
green |
placeholder@worldwideweb.de |
|
003 |
Sarah Parker |
39 |
yellow |
|
|
004 |
John Wayne |
44 |
blue |
0022556688 |
Phone No. |
004 |
John Wayne |
44 |
blue |
wayne@web.com |
|
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 |
|
002 |
Jane Roe |
38 |
green |
|
Phone No |
002 |
Jane Roe |
38 |
green |
|
Fax No |
002 |
Jane Roe |
38 |
green |
placeholder@worldwideweb.com |
|
003 |
Sarah Parker |
39 |
yellow |
|
|
004 |
John Wayne |
44 |
blue |
wayne@web.com |
|
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 |
|
|
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 |
It would be glad if you can help me in this case.