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 manipulate PPT with NPOI for .NET?

I made a lot of researchs about how to manipulate PPT with NPOI dll for .NET, but the examples are only to manipulate XLS files. Someone knows how to do it for PPT? In fact, what i need exactly is to upload a ppt file, and save each slide of this…
0
votes
0 answers

Use NPOI(C#) to modify an existing chart from an existing XLSX

We have a workbook.xlsx with charts in its first sheet. How can we modify these charts? Like add "data labels" or change their "axis labels" position? We can open the workbook (new XSSFWorkbook), get the sheet (workbook.GetSheet) and even reach the…
gpe
  • 13
  • 4
0
votes
1 answer

SQLBulkcopy - Header of datatable getting inserted in the database table

The header of the datatable is getting inserted as a record in the table. I am incrementing the row number but still the header gets inserted. Could someone tell me what the issue is ? If you see the code below the I am doing rows.MoveNext. …
user3751248
  • 303
  • 4
  • 8
  • 18
0
votes
1 answer

Unable to cast object of type 'NPOI.XSSF.UserModel.XSSFCell' to type 'System.IConvertible'

I am using NPOI to read the excel spreadsheet .I am gettting the above mentioned error at code dr["Amount"] = row.GetCell(4). Could somebody tell me what the problem is. XSSFWorkbook xssfwb; using (FileStream file = new…
user3751248
  • 303
  • 4
  • 8
  • 18
0
votes
1 answer

NPOI Multiple Sheets Error

I am trying to create an EXCEL XLSX file in a .net webcontext. I tried this code but as soon as I add more than 1 sheet my excel becomes corrupt. I am using NPOI 2.1.3 XSSFWorkbook wb = new…
Elias
  • 472
  • 3
  • 17
0
votes
1 answer

NPOI return a .xls file with NancyFx

I am trying to create a export function where i send the created .xls file to the user. I am using NancyFx for the requests and NPOI for the creation of the excel file. Can't figure out what is wrong with this code, i get a OK 200 response but not…
user1973285
0
votes
0 answers

How to change cell format from General to Date in asp.net C#

changing cell format from General to Custom datetime format but I want excel date format How can I achieve this .Currently I am using NPOI library of C# NPOI.SS.UserModel.ICellStyle dateSecondBlackCellStyle = setdateRowStyle(currentWorkBook,…
0
votes
0 answers

Importing Excel File Without Clicking on Column and Saving it using NPOI

If i export an excel and Import it (without opening it and clicking and saving it) then Second Second Column in Excel is Not readable in DataTable. Where as If I import that same file after Opening it and clicking on any Column and Saving it then…
0
votes
1 answer

Adding watermark using NPOI corrupts word document

I'm trying to use NPOI to add watermark to .docx document. Unfortunately documentation for NPOI is very scarce. I found one method CreateWatermark() that is suppose to add the watermark. public FileResult Test() { Stream stream = new…
cah1r
  • 1,751
  • 6
  • 28
  • 47
0
votes
0 answers

NPOI with "Template" gets ReadingNotSupportedException

I made a small wrapper class that holds NPOI Excel old format (XLS, 1997-2003). The code is something like: public class NpoiExcelDriver { /// /// Underlying workbook to work with. /// private HSSFWorkbook…
Tomer Cagan
  • 1,078
  • 17
  • 31
0
votes
1 answer

How to read TextBox objects with NPOI?

I have a XLSX Workbook with one single sheet with 5 TextBox (A1 to A5). How to get/set this objects values? Tnks
Luiz
  • 198
  • 2
  • 13
0
votes
1 answer

How to Set Page Break using NPOI in C#?

Is there any way to set the page break in EXCEL file using NPOI in C#..? I have follow the solution on this link, but still nothing happend on my generated excel files. I'm using NPOI 2.0.1.0.
Praditha
  • 1,162
  • 5
  • 24
  • 45
0
votes
2 answers

npoi SetCellFormula custom formula in VBA

I have an application that fills with data an excel template .Template is .xlsm .In template I created vba function called SumByColor when i try to set a cell formula to this function i get this error : {"Name 'SumByColor' is completely unknown in…
user2446025
  • 11
  • 1
  • 2
0
votes
1 answer

read corrupt excell-file with NPOI

I asked a similar question recently but thanks to the people that commented on that question I learned that the problem is more with excel than NPOI, so I deleted that question and rephrase it here. Anyway, my main problem is stated in my previous…
Johan Hjalmarsson
  • 3,433
  • 4
  • 39
  • 64
0
votes
1 answer

loop through Data for one or more UserIDs and create new worksheet for each User

Right now my code returns data from the database by userId(s) and specific date ranges. The results are then exported to a Excel spreadsheet. if more than one UserId is searched for then I need to have each UserId have there own worksheet in the…