你有没有将intCellType设置给需要的Cell。
设置number format的方法有两种,一种是使用NumberCellType,另一种是使用GeneralCellType。示例如下:- NumberCellType numCellType = new NumberCellType();
- numCellType.Separator = ",";
- numCellType.ShowSeparator = true;
- this.fpSpread1.ActiveSheet.Cells[0, 0].CellType = numCellType;
复制代码- GeneralCellType genCellType = new GeneralCellType();
- NumberFormatInfo info = new NumberFormatInfo();
- info.NumberDecimalDigits = 0;
- info.NumberDecimalSeparator = ".";
- info.NumberGroupSeparator = ",";
- genCellType.NumberFormat = info;
- this.fpSpread1.ActiveSheet.Cells[0, 1].CellType = genCellType;
复制代码 |