Krishnan Suba

Krishnan Suba

  • 1.6k
  • 82
  • 14.9k

I download the data from Address table to excel file

Aug 13 2019 3:27 AM
I used below below code for download the data form Address table to excel file, excel file will be downloading but data is not coming.
 
var addresses = AddressInfoProvider.GetAddresses() .Columns("AddressName", "AddressLine1", "AddressLine2", "AddressCity", "AddressZip", "AddressPhone") ;
foreach (AddressInfo addressInfo in addresses)
{
string AddressName = addressInfo.AddressName;
string AddressLine1 = addressInfo.AddressLine1;
string AddressLine2 = addressInfo.AddressLine2;
string AddressCity = addressInfo.AddressZip;
string AddressPhone = addressInfo.AddressPhone;
}
var websitePath = System.Web.HttpContext.Current.Server.MapPath("~/");
var FileName = "addresses-upload-template.xlsx";
var exportFilePath = FileHelper.GetFullFilePhysicalPath(ImportExportHelper.GetSiteUtilsFolder()) + FileName;
WriteFileToResponse(FileName);

Answers (1)