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
12
votes
2 answers

Edit existing Excel file C# npoi

I want to with a console application C# open an existing excel file and add content to it. NPOI 2.1.1.0 My first approach was simply to add a value to last cell figure I solved that it will solve my other problem. This will read the file correctly…
Henkljung
  • 123
  • 1
  • 1
  • 5
12
votes
2 answers

NPOI Auto resize column

I am trying to write some contents to excel file using NPOI. But while using the auto resize column method is causing a error "Parameter not valid". This happens only for sheets with huge data. Below is code which I used to do the job. public void…
Pravin K
  • 311
  • 2
  • 6
  • 19
10
votes
2 answers

Generate Excel with merged header using NPOI?

I tried to export excel sheet using NPOI like bellow but I am unable to change the background color and set second cell value. Bellow are my code. var workbook = new XSSFWorkbook(); var sheet = workbook.CreateSheet("Commission"); var row =…
Ajay Chaturvedi
  • 115
  • 1
  • 1
  • 8
10
votes
5 answers

Custom color for ICellStyle FillForegroundColor than provided named colors

We are newly started using NPOI components. We are having issues to set FillForegroundColor of ICellStyle property. ICellStyle HeaderCellStyle = xssfworkbook.CreateCellStyle(); HeaderCellStyle.FillForegroundColor =…
SivaRajini
  • 7,225
  • 21
  • 81
  • 128
9
votes
6 answers

c# npoi excel How to get a cell's formula VALUE?

I set a formula on some cells in a loop like this: System.String fm = "IF(B2,J2=J1,FALSE)" another.GetRow(0).CreateCell(28).SetCellFormula(fm); I always wondered how to get the result (value) of this formula and not copy the entire…
user7099027
  • 123
  • 1
  • 1
  • 7
9
votes
3 answers

SSIS Script Task cant find reference to assembly

I have an SSIS package that uses a script task to populate a datatable with data from a variety of different file types including excel. I am using NPOI to read in the data from Excel and have put the NPOI.dll file in the same folder as the SSIS…
Simon
  • 1,293
  • 5
  • 21
  • 39
9
votes
4 answers

NPOI - Get excel row count to check if it is empty

I'm reading an xlsx file using NPOI lib, with C#. I need to extract some of the excel columns and save the extracted values into some kind of data structure. I can successfully read the file and get all the values from the 2nd (the first one…
BeNdErR
  • 17,471
  • 21
  • 72
  • 103
9
votes
1 answer

NPOI Date Format Cell

I'm using NPOI to create fixed worksheet template in Sheet1, and need data from Sheet2 that's in date format.I generate DataTable from database to set data in Sheet2. It's my code : private DataTable getWeek() { strConn =…
Fajar Wahyu
  • 135
  • 2
  • 2
  • 8
9
votes
1 answer

can not found npoi.xssf.usermodel

I wanna use npoi to manipulate .xlsx files in VS2012/2010. To do so I should import NPOI.XSSF.UserModel, but when I add the npoi.dll and try to import that, there is no XSSF type of NPOI at Using part. I mean that there is no "Using NPOI.XSSF" Any…
9
votes
4 answers

Does NPOI have support to .xlsx format?

Will NPOI DLL recognize .xlsx file? Currently I'm using NPOI 1.2.5 version DLL for Microsoft Excel 97-2003, but I need to access Excel sheets of extension .xlsx also. Will NPOI support the above? Code snippet: static void Main(string[] args) { …
Ganeshja
  • 2,675
  • 12
  • 36
  • 57
8
votes
2 answers

How to get the Excel Cell value by address (A1, A2) using NPOI

I have an Excel Cell Address like A1, A2. How do I access this cell programmatically using NPOI framework in C#? Some Java POI example code I found: CellReference cr = new CellReference("A1"); row = mySheet.getRow(cr.getRow()); cell =…
Anand K G
  • 99
  • 1
  • 1
  • 10
8
votes
2 answers

NPOI setting background color isn't working

I need to set and remove the background color of rows. Somewhy when I set style to the row it isn't working - there is still no background color of the row. I've tried to set the CellStyle property of the single cell and use the HSSFStyle. The…
ProgBlogger
  • 175
  • 1
  • 6
  • 23
8
votes
2 answers

Quickest Way To Open Excel

I have been using the Microsoft.Office.Interop.Excel library to open Excel, refresh some queries and save. The issue I am running into is this will only work if each computer has the same Excel library as selected in the project installed on the…
8
votes
5 answers

creating chart in an excel spreadsheet using NPOI

I know that my question will be very similar to other ones already asked on SO but as I can't find a satisfying answer, I try my luck ! Does so know whether it's possible or not to generate charts in an Excel spreadsheet using the NPOI library. I…
pierroz
  • 7,653
  • 9
  • 48
  • 60
7
votes
2 answers

NPOI - Loading an Excel file causes Wrong Local header signature: 0xE011CFD0

Has anybody an idea what may cause this error 'Wrong Local header signature: 0xE011CFD0' var path = @"C:\Excel.xls"; using (var fs = File.OpenRead(path)) { var wb = new XSSFWorkbook(fs); } Im using: https://github.com/dotnetcore/NPOI
Joelty
  • 1,751
  • 5
  • 22
  • 64
1
2
3
40 41