Quantcast
Channel: NPOI
Viewing all 1621 articles
Browse latest View live

Updated Release: NPOI 2.2.1 (五月 21, 2016)

$
0
0
If you feel the release is good, buy me a coffee by donating to Paypal acount tonyqus@gmail.com. Thank you!

Follow us on Linkedin to get latest updates about NPOI: http://www.linkedin.com/company/neuzilla

Bug Fixes
- Fix a lot of serialization issue of ooxml issue
- Fix phonetic guides tag reading/writing issue
- Fix XWPFRun SetText exception issue
- Fix xml security issue
- Optimize memory for AutoResizeColumn
- Fix sqref property is missing on ProtectedRange
- Fix drawing ooxml issue and cell value bug
- Fix numFmtId property issue on NumFmt node
- Fix ooxml issues for RadarChart and CellStyle
- Fix xfrm namespace issue in ooxml
- Fix ScatterChart issue in ooxml
- Fix ooxml bugs in Vml entities
- fix bug when call ISheet.RemoveRow, it removes a wrong row
- don't close zip stream when zipoutputstream finish writing


Released: NPOI 2.1.3.1 (Feb 22, 2015)

$
0
0
Follow us on Linkedin to get latest updates about NPOI: http://www.linkedin.com/company/neuzilla

If you feel the release is good, buy me a coffee by donating to Paypal acount tonyqus@gmail.com. Thank you!

BUG FIXES
a. fix word serialization issues
b. fix CloneStyleFrom issue
c. Fix vertical alignment default value for XSSFCell
d. fix setAutoFilter change range issue
e. fix EDate function
f. fix FormatException in FormulaParser
g. fix Comment random Shape issue (comment serialization issue)
h. fix not be able to unlock the cell issue

POI BUG FIXES
55729 - DataFormatter should format Error cells, returning the Excel error string
49237 - HSSF Row Style XfIndex is 12 not 16 bits of data
54607 - NullPointerException in XSSFSheet.getTopRow() when the top row is 1
55745 - fix handling of tables in XSSF if there are comments as well
54673 - Simple wildcard support in HLOOKUP, VOOLKUP, MATCH, COUNTIF
55047 - REPT formula support
55042 - COMPLEX formula support
55041 - CODE formula support
54508 - EDATE formula support
53966 - IfError support (from Analysis Toolpak)
54402 - IfError handling of indirect references

NEW FEATURES
a. Add ReplaceText to XWPFParagraph and XWPFRun
b. adjust ExcelExtractor interface
c. Improving comment missing handling in HSSFSheet
d. copy hyperlink in CopySheet and fix some bugs
e. Implement ChartSheet in OpenXmlFormats
f. Implement shrinktofit for XSSF

Updated Release: NPOI 2.1.3.1 (二月 22, 2015)

$
0
0
Follow us on Linkedin to get latest updates about NPOI: http://www.linkedin.com/company/neuzilla

If you feel the release is good, buy me a coffee by donating to Paypal acount tonyqus@gmail.com. Thank you!

BUG FIXES
a. fix word serialization issues
b. fix CloneStyleFrom issue
c. Fix vertical alignment default value for XSSFCell
d. fix setAutoFilter change range issue
e. fix EDate function
f. fix FormatException in FormulaParser
g. fix Comment random Shape issue (comment serialization issue)
h. fix not be able to unlock the cell issue

POI BUG FIXES
55729 - DataFormatter should format Error cells, returning the Excel error string
49237 - HSSF Row Style XfIndex is 12 not 16 bits of data
54607 - NullPointerException in XSSFSheet.getTopRow() when the top row is 1
55745 - fix handling of tables in XSSF if there are comments as well
54673 - Simple wildcard support in HLOOKUP, VOOLKUP, MATCH, COUNTIF
55047 - REPT formula support
55042 - COMPLEX formula support
55041 - CODE formula support
54508 - EDATE formula support
53966 - IfError support (from Analysis Toolpak)
54402 - IfError handling of indirect references

NEW FEATURES
a. Add ReplaceText to XWPFParagraph and XWPFRun
b. adjust ExcelExtractor interface
c. Improving comment missing handling in HSSFSheet
d. copy hyperlink in CopySheet and fix some bugs
e. Implement ChartSheet in OpenXmlFormats
f. Implement shrinktofit for XSSF

Released: NPOI 2.2.1 (May 21, 2016)

$
0
0
If you feel the release is good, buy me a coffee by donating to Paypal acount tonyqus@gmail.com. Thank you!

Follow us on Linkedin to get latest updates about NPOI: http://www.linkedin.com/company/neuzilla

Bug Fixes
- Fix a lot of serialization issue of ooxml issue
- Fix phonetic guides tag reading/writing issue
- Fix XWPFRun SetText exception issue
- Fix xml security issue
- Optimize memory for AutoResizeColumn
- Fix sqref property is missing on ProtectedRange
- Fix drawing ooxml issue and cell value bug
- Fix numFmtId property issue on NumFmt node
- Fix ooxml issues for RadarChart and CellStyle
- Fix xfrm namespace issue in ooxml
- Fix ScatterChart issue in ooxml
- Fix ooxml bugs in Vml entities
- fix bug when call ISheet.RemoveRow, it removes a wrong row
- don't close zip stream when zipoutputstream finish writing

Updated Release: NPOI 2.2.1 (五月 21, 2016)

$
0
0
If you feel the release is good, buy me a coffee by donating to Paypal acount tonyqus@gmail.com. Thank you!

Follow us on Linkedin to get latest updates about NPOI: http://www.linkedin.com/company/neuzilla

Bug Fixes
- Fix a lot of serialization issue of ooxml issue
- Fix phonetic guides tag reading/writing issue
- Fix XWPFRun SetText exception issue
- Fix xml security issue
- Optimize memory for AutoResizeColumn
- Fix sqref property is missing on ProtectedRange
- Fix drawing ooxml issue and cell value bug
- Fix numFmtId property issue on NumFmt node
- Fix ooxml issues for RadarChart and CellStyle
- Fix xfrm namespace issue in ooxml
- Fix ScatterChart issue in ooxml
- Fix ooxml bugs in Vml entities
- fix bug when call ISheet.RemoveRow, it removes a wrong row
- don't close zip stream when zipoutputstream finish writing

Commented Issue: support for pivot table and pivot chart [10158]

$
0
0
Hello,
I need support for pivot table and pivot chart. I need support for changing ranges of pivot table and refresh pivot charts and pivot tables.
I need it in xlsx files, but if also xls files are supported it will be better.
Comments: ** Comment from web user: roneil_txhyd **

XLSX files created with a pivot table through the XSSFSheet, XSSFPivotTable, etc. classes will not open correctly in Excel 2013 and 2016.

The following error is displayed:
"Excel found unreadable content in '[filename]'. Do you wish to recover the contents of this work book? ... "

Clicking Yes displays the following:
"Excel was able to open the file by repairing or removing the unreadable content.
Removed Part: /xl/pivotCache/pivotCacheDefinition1.xml part with XML error. (PivotTable cache) Catastrophic failure Line 1, column 0.
Removed Part: /xl/pivotTables/pivotTable1.xml part with XML error. (PivotTable view) Catastrophic failure Line 1, column 0."

And the workbook contains no pivot table.

Source code (VB.NET from example in POI documentation):
```
Private Sub PoiPivotExample()
Dim wb As New XSSFWorkbook()
Dim sheet As XSSFSheet = wb.CreateSheet()

' Create some data to build the pivot table on
SetCellData(sheet)

Dim pivotTable As XSSFPivotTable = sheet.CreatePivotTable(New AreaReference("A1:D4"), New CellReference("H5"))

' Configure the pivot table
' Use first column as row label
pivotTable.AddRowLabel(0)

' Sum up the second column
pivotTable.AddColumnLabel(DataConsolidateFunction.SUM, 1)

' Set the third column as filter
pivotTable.AddColumnLabel(DataConsolidateFunction.AVERAGE, 2)

' Add filter on forth column
pivotTable.AddReportFilter(3)

Dim filePath As String = Path.Combine(My.Computer.FileSystem.SpecialDirectories.Desktop, "ooxml-pivottable.xlsx")

Using fileOut As FileStream = File.Create(filePath)
wb.Write(fileOut)
fileOut.Close()
wb.Close()
End Using
End Sub

Private Sub SetCellData(sheet As XSSFSheet)
Dim row1 As XSSFRow = sheet.CreateRow(0)
' Create a cell and put a value in it.
Dim cell11 As XSSFCell = row1.CreateCell(0)
cell11.setCellValue("Names")
Dim cell12 As XSSFCell = row1.CreateCell(1)
cell12.setCellValue("#")
Dim cell13 As XSSFCell = row1.CreateCell(2)
cell13.setCellValue("%")
Dim cell14 As XSSFCell = row1.CreateCell(3)
cell14.setCellValue("Human")

Dim row2 As XSSFRow = sheet.CreateRow(1)
Dim cell21 As XSSFCell = row2.CreateCell(0)
cell21.setCellValue("Jane")
Dim cell22 As XSSFCell = row2.CreateCell(1)
cell22.setCellValue(10)
Dim cell23 As XSSFCell = row2.CreateCell(2)
cell23.setCellValue(100)
Dim cell24 As XSSFCell = row2.CreateCell(3)
cell24.setCellValue("Yes")

Dim row3 As XSSFRow = sheet.CreateRow(2)
Dim cell31 As XSSFCell = row3.CreateCell(0)
cell31.setCellValue("Tarzan")
Dim cell32 As XSSFCell = row3.CreateCell(1)
cell32.setCellValue(5)
Dim cell33 As XSSFCell = row3.CreateCell(2)
cell33.setCellValue(90)
Dim cell34 As XSSFCell = row3.CreateCell(3)
cell34.setCellValue("Yes")

Dim row4 As XSSFRow = sheet.CreateRow(3)
Dim cell41 As XSSFCell = row4.CreateCell(0)
cell41.setCellValue("Terk")
Dim cell42 As XSSFCell = row4.CreateCell(1)
cell42.setCellValue(10)
Dim cell43 As XSSFCell = row4.CreateCell(2)
cell43.setCellValue(90)
Dim cell44 As XSSFCell = row4.CreateCell(3)
cell44.setCellValue("No")
End Sub
```

An example output file is attached.

Created Unassigned: IWorkbook.Write不同excel版本对流的关闭不一致 [13910]

$
0
0
HSSFWorkbook.Write(stream)
不会close stream.
XSSFWorkbook.Write(stream)
则会clsoe stream.

Created Unassigned: InvalidOperationException when writing xlsx file through .dll [13911]

$
0
0
When using a .dll to write an .xlsx file, I am getting the error below. The same code works when using a basic WinForms application:

InvalidOperationException: Type NPOI.OpenXmlFormats.ItemChoiceType is missing enumeration value 'r4' for element 'r4 from namespace 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'.
System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts)
System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace)
System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
Rethrow as InvalidOperationException: There was an error reflecting field 'Item'.
System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
Rethrow as InvalidOperationException: There was an error reflecting type 'NPOI.OpenXmlFormats.CT_Property'.
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts)
System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace)
System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
Rethrow as InvalidOperationException: There was an error reflecting field 'property'.
System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
Rethrow as InvalidOperationException: There was an error reflecting type 'NPOI.OpenXmlFormats.CT_CustomProperties'.
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.Xml.Serialization.XmlAttributeOverrides overrides, System.Type[] extraTypes, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
System.Xml.Serialization.XmlSerializer..ctor (System.Type type)
NPOI.OpenXmlFormats.CustomPropertiesDocument..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for NPOI.OpenXmlFormats.CustomPropertiesDocument
NPOI.POIXMLProperties..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for NPOI.POIXMLProperties
NPOI.POIXMLDocument.GetProperties ()
Rethrow as POIXMLException
NPOI.POIXMLDocument.GetProperties ()
NPOI.XSSF.UserModel.XSSFWorkbook.OnWorkbookCreate ()
NPOI.XSSF.UserModel.XSSFWorkbook..ctor ()

The basic code being used to write the file is:
```
if (!File.Exists(fullPath))
{
var wb = new XSSFWorkbook();

// create sheet
var sh = (XSSFSheet)wb.CreateSheet("Sheet1");
// 3 rows, 2 columns
for (int i = 0; i < 3; i++)
{
var r = sh.CreateRow(i);
for (int j = 0; j < 2; j++)
{
r.CreateCell(j);
}
}

using (var fs = new FileStream(fullPath, FileMode.Create, FileAccess.Write))
{
wb.Write(fs);
}
}
```

Thank you!

Created Unassigned: NPOI cell font color bug? [13913]

$
0
0
0
down vote
favorite
I am trying to read the font colour of an Excel cell using NPOI 2.2.1 or 2.1.3.1 It doesn't matter what the font colour is NPOI is always saying that it is 8 (black). Code fragment below

IWorkbook workbook = WorkbookFactory.Create(new FileStream(txtFileName.Text, FileMode.Open, FileAccess.Read));
ISheet worksheet = workbook.GetSheet("sheet1");
IRow row = worksheet.GetRow(0);
lblFontColor.Text = row.GetCell(0).CellStyle.GetFont(workbook).Color.ToString();
Is this a bug or am I doing something wrong?

Cheers Stew

Commented Unassigned: ISheet.RemoveRow does not work correctly [13887]

$
0
0
v2.1.3.1 XLSX format

1. use RemoveRow to remove the 2nd row
2. create a new row as the 2nd row and set cells value.
3. Write to file.

When I open the save file, the first row was remove and blank, and the 2nd row also blank.

Also see my question on SO:
http://stackoverflow.com/questions/36515060/npoi-not-write-all-cells-out
Comments: ** Comment from web user: paradise80 **

This is fixed in v2.2.1

Commented Unassigned: NPOI cell font color bug? [13913]

$
0
0
I am trying to read the font colour of an Excel cell using NPOI 2.2.1 or 2.1.3.1 It doesn't matter what the font colour is NPOI is always saying that it is 8 (black). Code fragment below

IWorkbook workbook = WorkbookFactory.Create(new FileStream(txtFileName.Text, FileMode.Open, FileAccess.Read));
ISheet worksheet = workbook.GetSheet("sheet1");
IRow row = worksheet.GetRow(0);
lblFontColor.Text = row.GetCell(0).CellStyle.GetFont(workbook).Color.ToString();
Is this a bug or am I doing something wrong?

Cheers Stew
Comments: ** Comment from web user: stewartmenday **

Update:
This only seems to be a problem when reading .xlsx files not the older .xls files

Created Unassigned: Incorrect value of calculation with INT operator [13924]

$
0
0
In the following example I try to calculate different formulas, but the results of calculation are sometimes incorrects (and really understandables) :

```
var workbook = new HSSFWorkbook();
var sheet = workbook.CreateSheet();
var row = sheet.CreateRow(0);
var cell = row.CreateCell(0);
var evaluator = workbook.GetCreationHelper().CreateFormulaEvaluator();

// should be 6.0 => OK
cell.SetCellFormula("INT(6.99)");
var cellValue = evaluator.Evaluate(cell);
var result = cellValue.NumberValue;

// should be 6.0 => KO : 7.0 is returned
var cell1 = row.CreateCell(1);
cell1.SetCellFormula("INT(6.991)");
var cellValue1 = evaluator.Evaluate(cell1);
var result1 = cellValue1.NumberValue;

// should be 6.0 => OK
var cell2 = row.CreateCell(2);
cell2.SetCellFormula("INT(6.9900000000000005)");
var cellValue2 = evaluator.Evaluate(cell2);
var result2 = cellValue2.NumberValue;

// should be 6.0 => KO : 7.0 is returned
var cell3 = row.CreateCell(3);
cell3.SetCellFormula("INT(6.9900000000000007)");
var cellValue3 = evaluator.Evaluate(cell3);
var result3 = cellValue3.NumberValue;
```

Am I doing something wrong ?

Created Unassigned: "Set Precision as displayed" in NPOI 2.2.1 version [13925]

$
0
0
Saving xlsx file using 2.2.1 version, "Set Precision as displayed" always set to true. Is there any way to make it as false?

Created Unassigned: Incorrect generated XLSX file [13926]

$
0
0
Hello...

I hace NPOI 2.2.1 and I realized that when generating XLSX file and opening with Excel 2013, a message box telling that a problem was encountered but Excel could try to recover from it. When I click "Yes", the sheet is finally shown.

This is the code:

```
IWorkbook workbook = new XSSFWorkbook();
ISheet sheet = workbook.CreateSheet(this.Title);

using (var exportData = new MemoryStream())
{
workbook.Write(exportData);
return exportData.GetBuffer();
}

```

As you see, I am only creating the workbook, adding a sheet and then returning the bytes array. That array is stored in file using this code:

```
string targetFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), String.Concat(btnExportar.Tag, "_", DateTime.Now.ToString("yyyyMMddHHmmss"), ".xlsx"));
System.IO.File.WriteAllBytes(targetFile, xls.GetExcelData());

```

With XLS files there is no problem.

Regards
Jaime

Commented Unassigned: Incorrect generated XLSX file [13926]

$
0
0
Hello...

I have NPOI 2.2.1 and I realized that when generating XLSX file and opening with Excel 2013, a message box telling that a problem was encountered but Excel could try to recover from it. When I click "Yes", the sheet is finally shown.

This is the code:

```
IWorkbook workbook = new XSSFWorkbook();
ISheet sheet = workbook.CreateSheet(this.Title);

using (var exportData = new MemoryStream())
{
workbook.Write(exportData);
return exportData.GetBuffer();
}

```

As you see, I am only creating the workbook, adding a sheet and then returning the bytes array. That array is stored in file using this code:

```
string targetFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), String.Concat(btnExportar.Tag, "_", DateTime.Now.ToString("yyyyMMddHHmmss"), ".xlsx"));
System.IO.File.WriteAllBytes(targetFile, xls.GetExcelData());

```

With XLS files there is no problem.

Regards
Jaime
Comments: ** Comment from web user: VincentM **

The Error lies in the core.xml file located in the docProps directory in the generated XLSX file.
The <cp:coreProperties> tag written by Excel is converted to <coreProperties> when NPOI writes the file.
I don't know what to do to correct the source code...

Regards
VincentM


Commented Unassigned: Incorrect generated XLSX file [13926]

$
0
0
Hello...

I have NPOI 2.2.1 and I realized that when generating XLSX file and opening with Excel 2013, a message box telling that a problem was encountered but Excel could try to recover from it. When I click "Yes", the sheet is finally shown.

This is the code:

```
IWorkbook workbook = new XSSFWorkbook();
ISheet sheet = workbook.CreateSheet(this.Title);

using (var exportData = new MemoryStream())
{
workbook.Write(exportData);
return exportData.GetBuffer();
}

```

As you see, I am only creating the workbook, adding a sheet and then returning the bytes array. That array is stored in file using this code:

```
string targetFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), String.Concat(btnExportar.Tag, "_", DateTime.Now.ToString("yyyyMMddHHmmss"), ".xlsx"));
System.IO.File.WriteAllBytes(targetFile, xls.GetExcelData());

```

With XLS files there is no problem.

Regards
Jaime
Comments: ** Comment from web user: tonyqus **

Please contact me via support@neuzilla.com and send me the Excel file. Something wrong in the core properties serializaiton.

Updated Wiki: Home

$
0
0
.NET技术 QQ群推荐:
上海技术群:343027179
北京技术群:124527967
广州技术群:550850466
(周边城市请就近添加,谢谢)
 
Who are We
Neuzilla is the studio behind NPOI. For detail, you can check http://blog.neuzilla.com/.

 

 
What's NPOI
This project is the .NET version of POI Java project at http://poi.apache.org/. POI is an open source project which can help you read/write xls, doc, ppt files. It has a wide application.
 
For example, you can use it to
a. generate a Excel report without Microsoft Office suite installed on your server and more efficient than call Microsoft Excel ActiveX at background;
b. extract text from Office documents to help you implement full-text indexing feature (most of time this feature is used to create search engines).
c. extract images from Office documents
d. generate Excel sheets that contains formulas
 
Our Sponsor (赞助商)
 
E-iceblue is a community sponsor of NPOI. 提供中文技术支持
Don't forget to have a try on Free Spire.XLS
XLS
 
 
Donate NPOI

支付宝捐款账号: tonyqus@163.com
Paypal: tonyqus@gmail.com


donate_btn
 
 
Advantage of NPOI
a. It's totally free to use
b. Cover most features of Excel (cell style, data format, formula and so on)
c. Support xls, xlsx, docx.
d. Designed to be interface-oriented (take a look at NPOI.SS namespace)
e. Support not only export but also import
f. .Net 2.0 based even for xlsx and docx (though we also support .NET 4.0)
g. Successful cases from all over the world
h. huge amout of basic examples
i. No dependency on isolated storage
 
To get the latest code, please visithttps://github.com/tonyqus/npoi.
 
 
Comments from NPOI users
image
image
image
image
image
 
 
Tutorial

NPOI on SNS
中文
QQ群: 189925337
 
English

System Requirement
VS2010 with .NET 4.0 runtime
VS2005 or VS2008 with .NET 2.0 Runtime (SP1)
vs2003 with .NET 1.1
Mono
medium trust environment in ASP.NET

 

 

 
Extensions
 

Released: NPOI 2.2.1 (May 21, 2016)

$
0
0
.NET技术 QQ群推荐:
上海技术群:343027179
北京技术群:124527967
广州技术群:550850466
(周边城市请就近添加,谢谢)

If you feel the release is good, buy me a coffee by donating to Paypal acount tonyqus@gmail.com. Thank you!

Follow us on Linkedin to get latest updates about NPOI: http://www.linkedin.com/company/neuzilla

Bug Fixes
- Fix a lot of serialization issue of ooxml issue
- Fix phonetic guides tag reading/writing issue
- Fix XWPFRun SetText exception issue
- Fix xml security issue
- Optimize memory for AutoResizeColumn
- Fix sqref property is missing on ProtectedRange
- Fix drawing ooxml issue and cell value bug
- Fix numFmtId property issue on NumFmt node
- Fix ooxml issues for RadarChart and CellStyle
- Fix xfrm namespace issue in ooxml
- Fix ScatterChart issue in ooxml
- Fix ooxml bugs in Vml entities
- fix bug when call ISheet.RemoveRow, it removes a wrong row
- don't close zip stream when zipoutputstream finish writing

Updated Release: NPOI 2.2.1 (五月 21, 2016)

$
0
0
.NET技术 QQ群推荐:
上海技术群:343027179
北京技术群:124527967
广州技术群:550850466
(周边城市请就近添加,谢谢)

If you feel the release is good, buy me a coffee by donating to Paypal acount tonyqus@gmail.com. Thank you!

Follow us on Linkedin to get latest updates about NPOI: http://www.linkedin.com/company/neuzilla

Bug Fixes
- Fix a lot of serialization issue of ooxml issue
- Fix phonetic guides tag reading/writing issue
- Fix XWPFRun SetText exception issue
- Fix xml security issue
- Optimize memory for AutoResizeColumn
- Fix sqref property is missing on ProtectedRange
- Fix drawing ooxml issue and cell value bug
- Fix numFmtId property issue on NumFmt node
- Fix ooxml issues for RadarChart and CellStyle
- Fix xfrm namespace issue in ooxml
- Fix ScatterChart issue in ooxml
- Fix ooxml bugs in Vml entities
- fix bug when call ISheet.RemoveRow, it removes a wrong row
- don't close zip stream when zipoutputstream finish writing

Created Unassigned: Cell CachedFormulaResultType throws System.InvalidOperationException [13931]

$
0
0
Reading cell value from formula based cell using its CachedFormulaResultType throws InvalidOperationException with message "Only formula cells have cached results".

For test read only column A of attached sample file. The cell is part of array formula. First cell of range contains CachedFormulaResultType but all other cells throw exception.

Method for reading value

```
private static string GetCellValue(ICell cell, CellType cellType)
{
string cellValue = string.Empty;
switch (cellType)
{
case CellType.Blank:
break;
case CellType.Boolean:
cellValue = cell.BooleanCellValue.ToString();
break;
case CellType.Error:
cellValue = "error";
break;
case CellType.Formula:
cellValue = GetCellValue(cell, cell.CachedFormulaResultType);
break;
case CellType.Numeric:
if (DateUtil.IsCellDateFormatted(cell))
{
cellValue = cell.DateCellValue.ToString("yyyy-MM-ddTHH:mm:ss.fffK");
}
else
{
var n = (decimal) cell.NumericCellValue;
cellValue = n.ToString(CultureInfo.InvariantCulture);
}
break;
case CellType.String:
cellValue = cell.StringCellValue;
break;
case CellType.Unknown:
break;
default:
break;
}
return cellValue;
}

```
Viewing all 1621 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>