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 sort data in excel in C# using NPOI library

How do I sort data in an excel spreadsheet using C# and NPOI library? The excel spreadsheet is very simple. There are two columns with header, "Name"(Column A) and "Birthday"(Column B). The data is in no way sorted. My goal is to sort the list by…
sora0419
  • 2,308
  • 9
  • 39
  • 58
0
votes
1 answer

Passing cell value of unknown type into overloaded method in DataTable loop

First time working with strict type language and having some problems. Data fetched from MySQL adapter fills a DataTable object. Column types remains the same as in MySQL table. Initiating NPOI, creating xls sheet. Next step is writing data in loop.…
Shad
  • 63
  • 1
  • 4
0
votes
2 answers

NPOI Page Breaks

I am using the NPOI framework to generate a 97/2003 Excel workbook. I need to set a page break every 44 rows and from the example provided in the framework download, the code to do this is: sheet.SetRowBreak(int row) I can verify these are setting a…
0
votes
1 answer

Font error in formula box in Excel?

I have an Excel file (.xls), it has about 1400 rows, there are rows which are displayed in correct font (both in sheet cells and in formula box which is docked at top). However there are some rows which are displayed with right font in sheet cells…
King King
  • 61,710
  • 16
  • 105
  • 130
0
votes
1 answer

Can't edit the existing Excel file with NPOI?

I've tried creating a new Excel file with NPOI and it works OK, reading (only) an Excel file is also OK. However now I want to open an existing Excel file and append some rows on it, it's crashed right at the code line of the…
King King
  • 61,710
  • 16
  • 105
  • 130
0
votes
2 answers

NPOI: Edit cell

I am using the following code to edit cells of an excel file but I dont see my changes in the escel file. using (var fs = new FileStream(reconnFileName, FileMode.Open, FileAccess.ReadWrite)) { HSSFWorkbook template = new…
Akshay J
  • 5,362
  • 13
  • 68
  • 105
0
votes
1 answer

NPOI and setCellFormula(): decimal-separator is cutoff

I've a serious problem copying this formula with NPOI 1.2.5 from one cell to another with C#: The original cell contain this: =IF(H21>(H23*0.9997);IF(H21<(H23*1.0003);"OK";"Errore");"Errore") The resulting cell reports exactly this formula, but…
0
votes
1 answer

how to read excel files by (column, row) with npoi and VISUAL BASIC

I'd like to be able to ready an excel file by column index, row by row, in VB .NET. I can do it extremely easily with python XLRD, and with vb6 via "ADOX.Catalog" Basically, this should be enough for my needs: wb = open(excelfile) ws =…
Berry Tsakala
  • 15,313
  • 12
  • 57
  • 80
0
votes
1 answer

Why does the content type of an uploaded excel file changes to application/octet-stream on mac in ASP MVC 4.0?

I'm having a little problem! I'm designing an asp mvc 4 application for a client which should import and process an excel file. To process the excel file I use the C# version of the NPOI framework. My client uses mac and I use windows. Everything…
0
votes
1 answer

NPOI Export DateTime issue

I made export with NPOI. I set cell value: row.CreateCell(6).SetCellValue("This is date string"); Now, excell see this as a text field and I need to excel set cell type to DateTime. Is this possible? I have…
1110
  • 7,829
  • 55
  • 176
  • 334
0
votes
2 answers

Insert image in xls file using npoi api?

I want to insert images in excel workbook's sheet. My code for inserting an image is here: ISheet sheet = templateWorkbook.GetSheet(sheetName); HSSFPatriarch patriarch =…
Master
  • 2,945
  • 5
  • 34
  • 65
0
votes
1 answer

Unable to Save Excel File using NPOI Library

I am having some difficulties exporting excel file using NPOI dll through ASP.NET page. Basically, I am able to populate the cells with no exception, however right at the few last steps where I need to export out the excel, it throws an exception…
developer
  • 718
  • 9
  • 28
0
votes
1 answer

Compile error when setting Excel cell to bold when using NPOI 1.2.5.0

We are trying to bold a row in excel , Visual studio 2008, framework 3.5 NPOI 1.2.5.0 - getting compile error Following is the code snippet, ICellStyle style1 = templateWorkbook.CreateCellStyle(); style1.SetFont(font1); HSSFWorkbook hssfworkbook =…
Sham Yemul
  • 463
  • 7
  • 30
0
votes
3 answers

NPOI Library will not insert rows/cell data when used in a loop

I am using the NPOI library within a c# console application to write some information to excel. The problem i seem to be facing is that the code will not run from within a a for loop (if i take the same code out of the for loop, it works and…
Modika
  • 6,192
  • 8
  • 36
  • 44
-1
votes
0 answers

Print directly from c# code from an excel sheet using NPOI?

was wondering if there is a way to get a print preview of an excel file via code I am using WinForms for an application and it requires me to print preview an excel file. would prefer it if its in NPOI as I have been using it and am familiar with…
MMil
  • 1
1 2 3
40
41