是不是数据类型的问题。。。。。。。。。。。。。
数字读出来是后面加了“.0”,中文也字母都为空。
后来发现,手动把数字的单元格格式-分类,改成文本就好了,但是怎么用代码去操作
注意下编码问题,GB2312,UTF8, Westen ISO, 看清楚该用哪个。
去哪里看
@拖鞋王子:
IWorkbook workbook = Factory.GetWorkbook();
IRange cells = workbook.Worksheets[0].Cells;
// Format column A as text.
cells["A:A"].NumberFormat = "@";
// Set A2 to text with a leading '0'.
cells["A2"].Value = "01234567890123456789";
// Format column C as text (SpreadsheetGear uses 0 based indexes - Excel uses 1 based indexes).
cells[0, 2].EntireColumn.NumberFormat = "@";
// Set C3 to text with a leading '0'.
cells[2, 2].Value = "01234567890123456789";
workbook.SaveAs(@"c:\tmp\TextFormat.xlsx", FileFormat.OpenXMLWorkbook);