Updated code to select unique ContactId data for Export File - Excel, Word and PDF