I not sure if I was clear, but the issue is not happening to all users.
We have one user in dublin that is reporting this error. Everyone else seems to be fine.
Below is the code I am using. I highlighted the columns that are in question.
string[] dtArry = new string[]
{
"JOURNAL_DATE",
"system_date",
"POSTED_DATE"
};
string[] amtArry = new string[]
{
"Amount",
"AbsAmount"
};
string[] strArry = new string[]
{
"operating_unit",
"Account_No"
};
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Name = "Data";
worksheet.Cells.ImportCustomObjects(this.GLList, clmAry, true, 0, 0, ((System.Collections.ICollection)this.GLList).Count, true, "MM/dd/yyyy", false);
string sourceData = "=Data!A1:AN" + this.GLList.Count.ToString();
Aspose.Cells.Style style = new Aspose.Cells.Style();
string[] array = amtArry;
for (int i = 0; i < array.Length; i++)
{
string column = array[i];
int x = System.Array.FindIndex(clmAry, (string r) => r.ToString() == column);
Range range = worksheet.Cells.CreateRange(1, x, this.GLList.Count, 1);
style.Number = 8;
range.SetStyle(style);
}
array = dtArry;
for (int i = 0; i < array.Length; i++)
{
string column = array[i];
int x = System.Array.FindIndex(clmAry, (string r) => r.ToString() == column);
Range range = worksheet.Cells.CreateRange(1, x, this.GLList.Count, 1);
style.Number = 14;
range.SetStyle(style);
}
array = strArry;
for (int i = 0; i < array.Length; i++)
{
string column = array[i];
int colIndex = System.Array.FindIndex(clmAry, (string r) => r.ToString() == column);
// Range range = worksheet.Cells.CreateRange(1, x, this.GLList.Count, 1);
Worksheet sheet = workbook.Worksheets[0];
Aspose.Cells.Style colStyle = sheet.Cells.Columns[colIndex].Style;
StyleFlag flag = new StyleFlag();
flag.NumberFormat = true;
style.Number = 49;
sheet.Cells.Columns[colIndex].ApplyStyle(colStyle, flag);
}
// Set the Header values
for (int i = 0; i < headerAry.Length; i++)
{
Cell cell = worksheet.Cells[CellsHelper.CellIndexToName(0, i)];
cell.PutValue(headerAry[i]);
}
if (this.SelectedExportFormat.ToLower() == ".xlsx")
{
workbook.Save(sPath, SaveFormat.Xlsx);
}
else
{
workbook.Save(sPath, SaveFormat.CSV);
}