Questions tagged [npoi]

.NET version of the Apache POI (Java) project

This project is the .NET version of the Apache POI project (the Java API for Microsoft Documents). POI is an open source project which can help you read/write xls, doc, and ppt files, so it has wide applications. For example, you can use it to generate an Excel report without Microsoft Office suite installed on your server and it is more efficient than calling Microsoft Excel ActiveX in the background; you can also use it to extract text from Office documents to help you implement full-text indexing feature (most of time this feature is used to create search engines).

Latest stable version: 2.6.0 / 17 November 2022

Latest actual source code: https://github.com/nissl-lab/npoi

612 questions
0
votes
1 answer

How to set NPOI excel chart title style (Overlay = false)?

XSSFChart chart; chart.SetTitle(); I know how to set the title, but can't find a way to set the title not to overlay the chart
JAYY5
  • 11
  • 2
0
votes
1 answer

Convert .xlsx file to html using NPOI

I want to convert .xlsx file to html using NPOI. Is this possible? I know , xls to html conversion is available using NPOI. But not sure if NPOI provide option to convert .xlsx file to html also. Thanks
shashank
  • 85
  • 8
0
votes
3 answers

Reading date columns from Excel

I am trying to read date cell from Excel file: private string GetDateValueFromRowOrNull(ISheet worksheet, int row, int column, StringBuilder exceptionMessage, CellType? cellType = null) { var cell = worksheet.GetRow(row).GetCell(column); if…
IpadNF
  • 1
  • 2
0
votes
1 answer

How to create a new column when editing an Excel file C# NPOI

I am trying to create a new column in the middle of an existing .xlsx sheet, but I can't find any way to do it. XSSFWorkbook workbook; await using (var file = new FileStream(@"File.xlsx", FileMode.Open, FileAccess.Read)) { workbook = new…
d51
  • 316
  • 1
  • 6
  • 23
0
votes
0 answers

Getting invalid calculated values of excel cells using ExcelDataReader, EPPlus and NPOI

I have an Excel sheet that has multiple sheets and is filled with formulas. There are some blank cells in this sheet that are to be filled by a user and saved to get different results with different inputs. I take the inputs from the users and write…
icamn
  • 1
  • 1
  • 1
0
votes
1 answer

The type arguments for method cannot be inferred from the usage. Try specifying the type arguments explicitly. Aspnet Zero ExcelExporter error

Got an error in aspnet zero ExcelExporter class. "The type arguments for method cannot be inferred from the usage. Try specifying the type arguments explicitly." NpoiExcelExporterBase.AddObjects(ISheet, IList, params Func[]) public…
comfreakph
  • 549
  • 2
  • 6
  • 20
0
votes
0 answers

How to keep the background color when you edit the excel sheet by POI

I code in C#. I use NPOI(version 2.5.5). But I link this OP to Apache POI as well because the solution for this would be the same for both modules. I have this excel file whose extention is .xlsx: I editted the Excel sheet via NPOI. code: private…
Angus B.
  • 23
  • 1
  • 8
0
votes
0 answers

Password protect opening Excel (xlsx) file using NPOI

How can I password protect opening Excel file (xlsx) file using NPOI? Operating system is Windows 10 without Java installed, runtime platform is .NET 4.7. There is class EncryptionInfo but there is no documentation how to use it, so please help me.…
Pavel Hodek
  • 14,319
  • 3
  • 32
  • 37
0
votes
0 answers

Light gray background color on Excel dissapears when editted by NPOI

I try to create new Excel file from a template Excel by copying, and edit the new Excel file by NPOI. The template has cells whose background colors are light gray. But the background colors of the light gray dissapear on the new Excel. Only light…
Angus B.
  • 23
  • 1
  • 8
0
votes
0 answers

NPOI Formula evaluation error IndexOutOfRangeException

I have an Excel.xls. There are many cells with complex formulas. When I got the results of several formulas, an exception occurred. var a = wk.GetCreationHelper().CreateFormulaEvaluator(); a.ClearAllCachedResultValues(); var cellv =…
xujie liu
  • 1
  • 1
0
votes
1 answer

Can't read a value of the cell with a formula inside properly by NPOI

I write in C#, and use NPOI.SS.UserModel to write a program to get value from the cell on Excel. The problem is the cell with formula. I am trying to get the result value from the formula cell, but I can't do it properly. The formula…
Angus B.
  • 23
  • 1
  • 8
0
votes
1 answer

How to find the difference between two 2D arrays in c#

I’ve two excel files and I want to extract the difference between them to put in another excel file. To find the difference I am using a specific reference column from each file to compare. Using the NPOI library, I stored the data from each excel…
0
votes
1 answer

How to remove extra spacing between lines using NPOI

I'm a new developer and need your help I'm using NPOI to create word documents based on txt files. Already have an word example and the format is ok. As you can see in this image, the space between lines is narrow : Image without spacing After I…
0
votes
1 answer

C# NPOI list numbering gets a different style from paragraphs

I made a list with custom numbering but numbering itself gets a different style from paragraphs run. How can I make numbering have the same styles as paragraphs XWPFRun? This is my numbering XWPFNumbering numbering = document.CreateNumbering(); …
Skyglar
  • 135
  • 3
  • 12
0
votes
1 answer

How to get used range in .net core by using NPOI

I'm using NPOI in my .net core library to do some operations in my excel sheet. I'm now want to get the used rang in the worksheet. Is there any way to achieve this target? For some reasons, I cannot use Microsoft.Office.Interop.Excel COM component.
Xie Steven
  • 8,544
  • 1
  • 9
  • 23