1

I am using Aspose cells for a pretty simple report. The problem is that I have a few fields that have leading zeros. When opened in CSV, I do not see the leading zeros. If I look at the text, I can see the zeros

Any ideas how to keep the leading zeros

thanks.

H20rider
  • 2,162
  • 5
  • 29
  • 47

1 Answers1

0

I dont feel this is the perfect solution, but I was able to get the results I wanted. Basically formatted the column with string.Format("=\"{0}\"", content.account_no)); But I had to interate through the rows

int curretCol = System.Array.FindIndex<string>(clmAry, (string r) => r.ToString() == "account_no");
                int currentrow = 1;

                foreach (GLSearchDC content in GLList)
                {
                    Cell cell = worksheet.Cells[CellsHelper.CellIndexToName(currentrow++, curretCol)];

                        cell.PutValue(string.Format("=\"{0}\"", content.Account_No));
                    content.account_no));
                }
H20rider
  • 2,162
  • 5
  • 29
  • 47