How to get the address of customer in a single line in Report in MSD axapta

To get the address field of customer in a single line in Report or form in axapta you can get hints by following code.


 DirPartyId partyId;  
  DirPartyAddressRelationship dirPartyAddressRelationship;  
  DirPartyAddressRelationshipMapping dirPartyAddressRelationshipMapping;  
  Address address;  
  str resultAddress;  
  ;  
  partyId = DirPartyTable::find(CustTable::find('1101').PartyId).PartyId;  
  select dirPartyAddressRelationship where dirPartyAddressRelationship.PartyId == partyId;  
  select dirPartyAddressRelationshipMapping where dirPartyAddressRelationshipMapping.PartyAddressRelationshipRecId == dirPartyAddressRelationship.RecId;  
  select address where address.dataAreaId == dirPartyAddressRelationshipMapping.RefCompanyId  
  && address.RecId == dirPartyAddressRelationshipMapping.AddressRecId;  
  resultAddress = address.Street+" "+address.City+", "+address.State+" "+address.ZipCode+" "+address.CountryRegionId;  
  info(resultAddress);  

I hope this code will help you a lot to play with address field in axapta