单元格设置 DoubleCellType 如下,数据导出后整数后会出现一个点,如何解决?
FarPoint.Web.Spread.DoubleCellType DoubleCellType = new FarPoint.Web.Spread.DoubleCellType();
int nDecimalDigits = 2;
Int32.TryParse(OneWeb.DataExt, out nDecimalDigits);
DoubleCellType.DecimalDigits = nDecimalDigits;
DoubleCellType.MaximumValue = 10000000000;
DoubleCellType.MinimumValue = -10000000000;
// 科学计数法处理
System.Globalization.NumberFormatInfo CellFormat = new System.Globalization.NumberFormatInfo();
CellFormat.NumberDecimalDigits = 4;
CellFormat.NumberGroupSizes = new int[] { 0 };
DoubleCellType.NumberFormat = CellFormat;
FpSpread1.Sheets[OneWeb.SheetIndex].Cells[OneWeb.RowNum, OneWeb.ColNum].CellType = DoubleCellType;
页面加载正常显示:
数据导出:123整数后会有一个点,
数据导出方法用的是
// 报表保存到Excel文件XLS
FpSpread1.SaveExcel(fileName);
|
|