回复 2楼yi357421的帖子
可以使用 GeneralCellType 来替代:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- FarPoint.Web.Spread.GeneralCellType objNumCell = new FarPoint.Web.Spread.GeneralCellType();
- System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
- nfi.NumberDecimalDigits = 6;
- nfi.NumberDecimalSeparator = ",";
- objNumCell.NumberFormat = nfi;
-
- FpSpread1.ActiveSheetView.Cells[0, 2].Formula =
- "SUM(" + FpSpread1.ActiveSheetView.Cells[0, 0].Column.Label.ToString() + FpSpread1.ActiveSheetView.Cells[0, 0].Row.Label.ToString() +
- "," + FpSpread1.ActiveSheetView.Cells[0, 1].Column.Label.ToString() + FpSpread1.ActiveSheetView.Cells[0, 1].Row.Label.ToString() +
- ")";
- this.FpSpread1.Sheets[0].Cells[0,0].CellType=objNumCell;
- this.FpSpread1.Sheets[0].Cells[0,1].CellType=objNumCell;
- }
复制代码 |