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

WHY Datatable add vaule have IndexOutOfRangeException in the c #

Raw data (EXCEL FILE) 1TEST101 TEST1 YOYO 2015/11/25 1:38 PM 1TEST102 TEST2 YOYO 2015/11/23 9:17 PM 1TEST103 TEST3 YOYO 2015/11/23 9:15 PM 1TEST104 TEST4 YOYO 2015/12/10 6:13 PM 1TEST105 TEST5 YOYO 2015/12/10…
square
  • 123
  • 1
  • 1
  • 11
0
votes
1 answer

Copy HSSFCellStyle to XSSFCellStyle in NPOI

My input file is .xls from where I have to read data, manipulate and write back to .xlsx file along with the styles. So, using NPOI HSSF to read from .xls and NPOI XSSF to generate the .xlsx file. I am done with the data. But I have to copy the cell…
Sobhan
  • 796
  • 1
  • 9
  • 31
0
votes
0 answers

How can I apply gradient in excel row using xssfworkbook in c#

set gradient in outline in excel cell background in xssfworkbook using namespace npoi with c# and display output ? NPOI.OpenXmlFormats.Spreadsheet.CT_Fill myGradientFill = NPOI.OpenXmlFormats.Vml.CT_Fill.Factory.newInstance();
PParmar
  • 95
  • 2
  • 9
0
votes
1 answer

NPOI ArgumentOutOfRangeException on WorkbookFactory.Create

I have been using NPOI to read Excel files, and I now need to write out files. I am trying to use the WorkbookFactory, which doesn't show up in a lot of examples online (doesn't appear in the NPOI examples on CodePlex either). Here is the…
Tim
  • 1,621
  • 4
  • 19
  • 35
0
votes
1 answer

NPOI 2.2.1 generates incorrect XLSX file

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…
jstuardo
  • 3,901
  • 14
  • 61
  • 136
0
votes
2 answers

SpreadsheetGear Excel using EPPLUS/NPOI not readable

Have anyone comes across this? I receive file from client which is generated through SpreadsheetGear. It looks fine if I open it in excel But it can't find data into cells if I try to read through EPPLUS or NPOI I believe SpresheetGear misses some…
user2739418
  • 1,623
  • 5
  • 29
  • 51
0
votes
1 answer

NPOI GetFormat or GetBuiltinFormat

While applying CellStyle to a cell using GetFormat or GetBuiltinFormat for "#,#0" , the same is not getting rendered in the cell. Am I missing something? For example the number rendered on cell should show up as 10,000 while on click the same the…
Vinay
  • 471
  • 3
  • 8
  • 19
0
votes
2 answers

NPOI cell font color bug?

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…
stew
  • 87
  • 2
  • 8
0
votes
1 answer

Writing on open Excel application using NPOI

folks, Environment Windows 8.1 Visual Studio 2013 C# Issue How do I write values and make charts on visible Excel sheets using NPOI (https://npoi.codeplex.com/). Why do I want that? I'm developing an application to measure temperature in an…
dixhom
  • 2,419
  • 4
  • 20
  • 36
0
votes
1 answer

Debugging NPOI NuGet code

I am working on a project in which I use NPOI v2.3.1 NuGet package. While debugging my code, I see the following messages in output without an actual exception being thrown: Exception thrown: 'NPOI.OpenXml4Net.Exceptions.InvalidFormatException' in…
Bahaa
  • 1,577
  • 18
  • 31
0
votes
1 answer

NPOI AutoSizeColumn not resizing correctly

I've put the .AutoSizeColumn right before the write Method int numberOfColumns = sheet.GetRow(rowcount - 1).PhysicalNumberOfCells; for (int i = 0; i <= numberOfColumns; i++) { sheet.AutoSizeColumn(i); GC.Collect(); } using (var fileData =…
Derpzilla
  • 1
  • 2
  • 3
0
votes
0 answers

Add a link to an image in NPOI

I am using NOPI to generate Excel files and I am adding images to the Excel using the following code: //the drawing patriarch will hold the anchor and the master information HSSFPatriarch patriarch =…
Slee
  • 27,498
  • 52
  • 145
  • 243
0
votes
0 answers

NPOI Excel Format not working

I have a function that is generating an Excel file using the NPOI Library. Witch for the most part is working fine just got a problem with style's they seem to function dodgy. Currently my focus is the number formats: I would like all decimals to…
Jester
  • 3,069
  • 5
  • 30
  • 44
0
votes
2 answers

manipulate data before importing from excel to dataset

I have a couple of columns of data in an excel sheet which I have to import to my application. I do this using - string strConn; OleDbDataAdapter oledaExcelInfo; strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " +…
pavanred
  • 12,717
  • 14
  • 53
  • 59
0
votes
3 answers

C# - Pass a variable type to Generic method

I have this code using NPOI. I'm trying to have an object that will be a either aHSSFWorkbook or a XSSFWorkbook depending on version of excel file. It is possible to have an Type and past it to generic method in order to cast then return either…
jmvtrinidad
  • 3,347
  • 3
  • 22
  • 42