NPOI
NPOI copied to clipboard
A .NET library for reading and writing Microsoft Office binary and OOXML file formats.
HSSFCellUtil.CopyCell: 当复制某单元格,例如A1; 第一次调用copycell,没有问题,复制可以正常执行; 但第二次复制A1时,就会提示font records的异常。 There are only 58 font records, you asked for 158; 经过调试后发现是由于以下代码造成问题: newCell.RichStringCellValue.ApplyFont(startIndex,endIndex, font); 通过断点调试发现,首次复制单元格时在执行applyfont前startIndex的值一直都是正确的值(例如18),当在执行正常执行applyfont后,再次通过rts.GetFontOfFormattingRun(j)获取startIndex的值时却发现该值被修改为158,所以在第二次再次复制A1时触发异常导致复制失败。 这个bug在跨workbook时经常发生,如果需要提供导致bug发生的测试数据可以联系我的QQ:479038057
我不能将源文件更改为wls格式,因为更改个时候文件内的数据会有改变。请问如果需要导入csv文件,有什么其他办法解决这个问题么? Invalid header signature; read 0xF8D2CCC9D0D52023, expected 0xE11AB1A1E011CFD0 - Your file appears not to be a valid OLE2 document
严重性 代码 说明 项目 文件 行 禁止显示状态 错误 CS0433 类型“SerializableAttribute”同时存在于“Npoi.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null”和“System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”中 WindowService D:\GIT\travelcloudset\WindowService\Service\ParaFilter\MyException.cs 7 活动的
Currently, the last stable version according to NuGet is 1.2.1, but according to the repo the latest version is 1.2.2. Anyways, I'm trying to smooth a chart, and I'm following...
这样直接赋值生成的docx用office word2007打不开,但wpf可以正常打开。 报错为“无法打开office Open XML 文件 xxxxx.docx,因为内容有误” `targetCell.Paragraphs[0].Style = null`
用word2007打开会很多重复页,但wpf正常 `firstCell.Paragraphs[0].IsPageBreak = true;`
http://thyrsi.com/t6/390/1539872939x-1404781240.png private static object GetCellStrValue(ICell cell) { try { return cell.StringCellValue; } catch(Exception ex1) { return cell.ToString(); } } cell.StringCellValue;会抛异常, cell.ToString()会丢失开头的0。 在excel里,右键设置单元格格式,会显示自定义格式 [img]http://thyrsi.com/t6/390/1539915808x-1404781126.png[/img]
I have a problem when i try to read my excel file with : `IWorkbook workbook = null;` `using (FileStream file = new FileStream(PathFile + sourceFile, FileMode.Open, FileAccess.Read)) {` `if...
填充背景颜色无效
给单元格设置背景颜色无效,不起作用 ``` [Fact] public void Test2() { FileStream fs = new FileStream("D:\\测试Npoi_007.xls", FileMode.Open); HSSFWorkbook workbook = new HSSFWorkbook(fs); HSSFSheet currentSheet = (HSSFSheet)workbook.GetSheet("测试工作表"); HSSFCellStyle style8 = (HSSFCellStyle)workbook.CreateCellStyle(); style8.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.Yellow.Index; style8.FillBackgroundColor...