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

Exception thrown in NPOI while opening a file, but only in release mode

I just made a class that can translate an Excel file into a list of C# objects. I am currently working on Xamarin.Android. All worked fine in debug mode, the file was opening correctly. But when I changed to release mode, it just crashes without any…
0
votes
0 answers

NPOI C# - Evaluating Formula Cells with blank references

I have an Excel template which has a table to be filled-up (e.g. A1:C10, 10 rows). I fill up its rows using NPOI in C#. Cells of Column C has a formula that is referencing to other cells (e.g. =SUM(A1:B1)). I also use…
jr0115
  • 31
  • 1
  • 4
0
votes
0 answers

NPOI C# - Copy ranged cells of one workbook to another

Is it possible to copy selected ranged cells of one workbook to another using NPOI in C#? If yes, can I have sample of how it is done? So far, I am stuck with: sheet.SetActiveCellRange(0,3,0,3); I am not sure how to move forward from this code.…
jr0115
  • 31
  • 1
  • 4
0
votes
1 answer

How to create specific cellstyles with xssf in c# (NPOI)

I'm creating an excel xlsx file from scratch with NPOI in c#, and need to have specific cellstyles for each of my cells. But as far as i can tell, every time i change the cellstyle of one of my cells, it modifies another unrelated cell. Each time I…
Triterium
  • 13
  • 7
0
votes
1 answer

NPOI On importing excel - returning the UI inside UI instead of the table in UI

I need to create a view in ASP.NET Core which takes excel as input in the form of file upload and displays a table of the contents of the excel file in the UI. I followed this blog to try and use NPOI library for fulfilling my purpose. My View goes…
Sonali Agrawal
  • 303
  • 4
  • 14
0
votes
1 answer

What is the easiest way to count .xlsx workbook sheets using c#, NPOI and an XSSF workbook?

I am trying to count the number of sheets in a workbook. The workbook is created using NPOI and there doesn't seem to be a way to count the amount of sheets using the C# version of NPOI? This is a really tricky thing to both explain and show... But…
0
votes
0 answers

Is there any method to extract charts from excel using NPOI?

Is there any method to extract charts from excel using NPOI, or to extract the XML code and parse it into a word document ? I don't find any support to extract the xml or the chart, i need the chart object the solution with image don't work, i can't…
Cristian
  • 37
  • 1
  • 8
0
votes
0 answers

Why docx file is corrupted after creating with NPOI

I wrote the simple code, but even it doesn't work. I receveid the file that MS Word can't open. XWPFDocument doc; using (Stream fileStream = System.IO.File.OpenRead(pathTemplate)) { doc = new XWPFDocument(fileStream); …
vovkor
  • 1
  • 1
  • 1
0
votes
1 answer

npoi c# column number discrepency

I'm trying to parse an excel spreadsheet, which in the past has been a breeze with the C# NPOI port. However, this time I'm finding that column "0" is changing from one row to the next. I am trying to access the Cells property of an HSSFRow. It…
BVernon
  • 3,205
  • 5
  • 28
  • 64
0
votes
1 answer

NPOI SetCellValue plote nothing on the excel

I've just started using NPOI to generate xls file, but when I try the SetCellValue I got nothing writed on the excel. My code is : CellsCombined = New CellRangeAddress(0, 4, 2, 4) hoja.AddMergedRegion(CellsCombined) …
0
votes
1 answer

NPOI excel page break get last row number

I create a Excel sheet with NPOI in a C#-program and I can loop to each row. For some rows I define HeightInPoints and I can do this for all rows. The auto page break breaks not at the row I want, so Ihave to do this in code. How can I find out,…
0
votes
2 answers

NPOI with VB how to set cellstyle dataformat to DATE

I'm using VB and NPOI to write DATE data to an excel ROW. I'm trying to use the following code to set the dataformat of the cell to "mm-dd-yy", but I keep getting an index out of range error when setting the cell.cellstyle. There are a number of C…
0
votes
1 answer

NPOI issue with FirstRowNum and LastRowNum returning -1 for a sheet that has rows

When trying to get the rows from an Excel sheet using NPOI, FirstRowNum and LastRowNum return -1. IWorkbook workbook = null; List excelRows = new List(); MemoryStream ms = new MemoryStream(array); ISheet sheet =…
radu
  • 35
  • 6
0
votes
0 answers

Unable to load the file or assembly to use class XSSFWorkbook in NPOI library

I'm using the NPOI library to read a .xlsx document and convert to dataSet. When I try to instantiate the class XSSFWorkbook, I get an error. My code: Dim file As New FileStream(myFile, FileMode.Open, FileAccess.Read) Dim oDs As New List(Of…
0
votes
1 answer

Adding currency format in excel export using NPOI dll - not working

I am exporting data in excel file using NPOI dll. The data is of amount type that has to be shown in money format: $#,###.## and also in date format. I've added the format to the cells. but the data is not exporting to Excel as a Money/date…
chaya D
  • 129
  • 1
  • 13