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

Npoi xls file save corrupts excel file

So I am able to open and dig through an xls (Excel 97-2003) file. However, the problem is when I try to save it. After I save it, and it succeeds, I then go and manually open the Excel file and get an error saying that it cannot open the Excel file…
Godrules500
  • 467
  • 6
  • 25
0
votes
1 answer

why NPOI created cell drop down list always split by comma

I use NPOI(the .net version of java - Apache POI) created excel sheet. I need to add some dropdown, but I found no matter what list I passed into it, it always split the item value by comma, thus make a new line. In any chance, do you know how to…
Steven Zack
  • 4,984
  • 19
  • 57
  • 88
0
votes
1 answer

NPOI method GetFormat("@") is showing "Date" instead of "Text"

I found the solution on stackoverflow for setting one column of Excel file as Text. DataFormat currDataFormat = this.Workbook.CreateDataFormat(); CellStyle textStyle = this.Workbook.CreateCellStyle(); textStyle.DataFormat =…
Emma Thapa
  • 767
  • 1
  • 7
  • 14
0
votes
0 answers

Does a VBA module in Excel treated as a spreadsheet in NPOI or POI?

I am working on a NPOI project. I have an Excel file which contains 5 spread sheets out of which: 2 are hidden (as they are dialog, user interface, kind of sheets DlgView1, DlgView2). 3 work sheets (WrkSht1, WrkSht2, WrkSht3) are visible with…
MgmtTech
  • 11
  • 3
0
votes
3 answers

How to export a DataTable variable to EXCEL and download the excel

I'm trying to use NPOI like this: private Stream RenderDataTableToExcel(DataTable SourceTable) { XSSFWorkbook workbook = null; MemoryStream ms = null; ISheet sheet = null; XSSFRow headerRow = null; try { workbook =…
hashtabe_0
  • 137
  • 2
  • 3
  • 11
0
votes
1 answer

NPOI: xlsx with non empty cells read as only having null rows

Using NPOI like this: static void xlsx() { XSSFWorkbook xsswb; using (FileStream file = new FileStream(@"test.xlsx", FileMode.Open, FileAccess.Read)) { xsswb = new XSSFWorkbook(file); } ISheet…
pomarc
  • 2,194
  • 3
  • 23
  • 30
0
votes
0 answers

why NPOI excel textboxes share same textvalues?

I created 3 different textboxes in my excel work sheet XSSFDrawing drawing = (XSSFDrawing)activeWorkSheet.CreateDrawingPatriarch(); IClientAnchor anchor1= drawing.CreateAnchor(0, 0, 0, 0, left1, top1, right1, bottom1); IClientAnchor anchor2=…
POI Root
  • 1
  • 1
0
votes
3 answers

How to remove empty rows and reduce total rows count in excel using NPOI with C#

I am trying to remove empty rows in excel file using npoi with C#. i am facing the problem with my code can any one help on this please. public static void removeRow(string filepath,string SheetName) { try { IWorkbook workBook =…
Srikanth E
  • 55
  • 2
  • 10
0
votes
1 answer

NPOI / POI Excel Lib ISheet.ShiftRows Index Out of Range Exception

I am using .ShiftRows in NPOI to insert a new row into an Excel file. However, I am getting a System.ArgumentOutOfRangeException on certain files when trying to shift the rows down to insert a new row. These are just generic files from different…
justiceorjustus
  • 2,017
  • 1
  • 19
  • 42
0
votes
2 answers

How to save an XLS file several times (once after each modification) using NPOI

I'm new to NPOI, and I have a question for which I could not find a "simple" answer / solution. (I don't want to close and open a file 5 times.) I need to edit an XLS file, (let's say I want to modify 5 cells from value 0 to 1), but I must save the…
EyalS
  • 11
  • 3
0
votes
1 answer

C# Working with excel file

After save changes from dataGridView,when open xlsx file by excel this error occurs: We found a problem with some content in 'Book1.xlsx' Do you want us to recover as much as we can? If you trust the source of this workbook, click Yes. for…
DanialDP
  • 25
  • 1
  • 11
0
votes
1 answer

Issue downloading .xlsm document with activex controls using NPOI

I am trying to implement an excel file download functionality in my asp.net MVC application and using NPOI. The file has three sheets and Sheet2 has two activex buttons. I am reading the source file, adding values to sheet2, save it in temporary…
RandomUser
  • 1,843
  • 8
  • 33
  • 65
0
votes
0 answers

How can I show a status when building a document for download in ASP.Net?

I am iterating through multiple recordsets to create multiple Excel worksheets that can take up to 30 seconds for the results, so I want to provide the user with feedback. A Processing.gif would be fine, but I would rather list the name of each…
Andy In NC
  • 112
  • 1
  • 8
0
votes
1 answer

Copying Data from one Sheet to Another using NPOI

I'm new to C# and Excel and I'm trying to copy data from one sheet (that is full of data) to a new one that is empty. I'm using NPOI and I've figured out a few things, but I have problems when adding the data. The second sheet is empty, so all the…
0
votes
1 answer

NPOI excel open issue

I'm struggling on an issue for many hours but have no idea where is the problem and how to fix it. Hope you could give me some hints. I would much appreciate. The main idea of the following code is to read document in documentlist and open each…
Jacob
  • 91
  • 2
  • 10