您好,
可以使用以下代码,看是否能够解决您的问题:- private void button1_Click(object sender, EventArgs e)
- {
- fpSpread1.SaveExcel("test.xlsx", FarPoint.Excel.ExcelSaveFlags.SaveAsViewed | FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
- }
- private void Form2_Load(object sender, EventArgs e)
- {
- SetColumnType();
- fpSpread1.ActiveSheet.Cells[1, 1].Value = "是";
- fpSpread1.ActiveSheet.Cells[2, 1].Value = "否";
- fpSpread1.ActiveSheet.Cells[4, 1].Value = "是";
- }
- private void SetColumnType()
- {
- String[] cbstr;
- cbstr = new String[] { "否", "是" };
- String[] strval;
- strval = new String[] { "0", "1" };
- ComboBoxCellType cb = new ComboBoxCellType();
- cb.Items = cbstr;
- cb.ItemData = strval;
- cb.EditorValue = EditorValue.String;
- this.fpSpread1.ActiveSheet.Columns[1].CellType = cb;
- }
复制代码 |