Combine 2 fields in Report

RMolenaarRMolenaar Member Posts: 94
edited 2015-05-01 in NAV Three Tier
Hello,

I want to show 2 fields in a Report: "Phone No_" and "Mobile Phone No_"
So it will be like this:

Phone No.: 0123-456789 / 06-123456789

The slash / must be hidden when only one number is shown.
I think it will be a COMPRESSARRAY function?

Thank you
Rob
Microsoft Dynamics NAV 2013 R2
NAV 7.1

Answers

  • yukonyukon Member Posts: 361
    Hi,

    I may not so sure your phone no. and mob. no. are putting in one textbox.(I assume rtc report). If yes you can do this way at rdlc textbox expression
    = Fields!Phone_No_.Value + iif(String.IsEmptyOrNull(Fields!Phone_No_.Value) and String.IsEmptyOrNull(Fields!Mob_No_.Value),String.Empty,iif(String.IsEmptyOrNull(Fields!Mob_No_.Value),String.Empty," / ")) + Fields!Mob_No_.Value
    


    Regards,
    Yukon
    Make Simple & Easy
  • RMolenaarRMolenaar Member Posts: 94
    Thank you,

    I changed your code because IsEmptyOrNull must be IsNullOrEmpty ;)
    = Fields!Cust_PhoneNo.Value + iif(String.IsNullOrEmpty(Fields!Cust_PhoneNo.Value) and String.IsNullOrEmpty(Fields!Cust_MobPhoneNo.Value),String.Empty,iif(String.IsNullOrEmpty(Fields!Cust_MobPhoneNo.Value),String.Empty," / ")) + Fields!Cust_MobPhoneNo.Value
    

    Almost working now. However, when only MobPhoneNo is filled the "/" is showing before the Mobile Phone No. on the Report.
    Microsoft Dynamics NAV 2013 R2
    NAV 7.1
  • RMolenaarRMolenaar Member Posts: 94
    Already solved this issue with this code:
    = Fields!Cust_PhoneNo.Value + iif(String.IsNullOrEmpty(Fields!Cust_PhoneNo.Value) or String.IsNullOrEmpty(Fields!Cust_MobPhoneNo.Value),String.Empty," / ") + Fields!Cust_MobPhoneNo.Value
    
    Microsoft Dynamics NAV 2013 R2
    NAV 7.1
Sign In or Register to comment.