I have attached the tab delimited file and the excel file, to show that for the excel file it has no issue. Also the code for the creation of the files are below.
public void FillData(System.IO.Stream excelFile, string saveTo, IList objects,
bool shouldIncludeExcelFile)
{
Workbook workBook = new Workbook(excelFile);
workBook.Worksheets.ActiveSheetIndex = 0;
Worksheet workSheet = workBook.Worksheets[0];
workSheet.Cells.ImportCustomObjects(objects.ToList(), 0, 0,
new ImportTableOptions
{
TotalRows = objects.Count,
TotalColumns = -1,
IsFieldNameShown = true
});
if (shouldIncludeExcelFile)
{
Aspose.Cells.Tables.ListObject lo = workSheet
.ListObjects[workSheet.ListObjects.Add(0, 0, workSheet.Cells.MaxDataRow,
workSheet.Cells.MaxDataColumn, true)];
lo.TableStyleType = Aspose.Cells.Tables.TableStyleType.TableStyleMedium2;
workSheet.AutoFitColumns();
workBook.Save(string.Format("{0}.xlsx", saveTo), SaveFormat.Xlsx);
}
TxtSaveOptions options = new TxtSaveOptions(SaveFormat.TabDelimited) { };
// workBook.Settings.Encoding = Encoding.ASCII; //doesnt work
workBook.Save(string.Format("{0}.txt", saveTo), options);
}