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

NPOI creating excel with SXSSFWorkbook - error on opening

I just want to stream a xlsx file using NPOI SXSSF method. But when I download streamed excel file in opening pops up message: Excel found unreadable content in 'MyExcelFile.xlsx'. Do you want to recover the contents of the workbook? If you…
Ondra Starenko
  • 428
  • 1
  • 6
  • 12
0
votes
1 answer

NPOI is generating a 0 bytes stream

I am using a C# code that works perfectly in other projects.... but in this one, it is returning a 0 bytes length stream. This is how I am saving the stream: using (var exportData = new MemoryStream()) { …
jstuardo
  • 3,901
  • 14
  • 61
  • 136
0
votes
1 answer

Reading/Writing CustomDocumentProperties from xlsx file without interop

is it possible to read/write CustomDocumentProperties from an xlsx file without using Excel interop but purely by manipulating the XML or using a library like NPOI. Basically, I need to in an MVC application to allow a user to download an xlsx file…
Peter
  • 87
  • 9
0
votes
0 answers

Xamarin How to port code Syncfusion DocIO to NPOI Word

I have a problem with creating the header of a Word document. This is my code for Syncfusion: WordDocument document = new WordDocument(); IWSection section = document.AddSection(); IWParagraph paragraph =…
Deivid.PL
  • 31
  • 6
0
votes
1 answer

NPOI version 2.2+ MemoryStream.ToArray() 0 bytes

Using NPOI version 2.1.3.1, this line works perfectly, returning a a byte array with data: workbook is an XSSFWorkbook using (var memoryStream = new MemoryStream()) { workbook.Write(memoryStream); return memoryStream.ToArray(); } when…
0
votes
2 answers

NPOI set readonly to excel

Is there a way to produce a workbook using NPOI that has doesn't allow user to edit the workbook unless saving a new copy? Basically I want to produce a file that is a read-only excel, and that no users will have conflict when opening them when…
CozyAzure
  • 8,280
  • 7
  • 34
  • 52
0
votes
1 answer

How to add hyperlink in word using NPOI

I have been researching for the best thirdparty dll to generate word document. Finally I found NPOI is very good to write word document. But I am unable to add the hyperlink to document.
san thu
  • 1
  • 1
0
votes
1 answer

NPOI Autosize Columns (SXSSFWorkbook)

OK, so I'm using version 2.3.0 of the NPOI. My Workbook is SXSSFWorkbook format. I'm trying to autosize the columns...but I can't figure out how to use the NEW Autosize Tracker. Can anyone figure this out? It was a bug fix, here is the web…
Mark Smith
  • 41
  • 5
0
votes
1 answer

Is there a version of NPOI that works with ASP.NET Core 1.1 (not core 2.0)

Is there a version of NPOI that works with ASP.NET Core 1.1 (not core 2.0). Every package is either for the Windows version or Core 2.0, which, in both cases, is not working with Core 1.1. Thanks for helping
Richard77
  • 20,343
  • 46
  • 150
  • 252
0
votes
1 answer

Bootstrap Modal Won't Hide After Downloading Excel File

I'm using NPOI to allow users to download an Excel file from my website (asp.net / C# / bootstrap 4). The part that actually downloads the file looks like this: //***************************************** //* Workbook Download &…
Jimmy Genslinger
  • 557
  • 3
  • 21
0
votes
2 answers

NPOI SetCellValue method doesn't write data to cells

I have some problem with writing data to Excel worksheet cells using NPOI. Here is my code: FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read); hssfworkbook = new HSSFWorkbook(file); ISheet sheet1 =…
0
votes
1 answer

Format cell as Percentage with NPOI C#

I am trying to format a specific XLS cell to the "Percentage" format using NPOI. I am able to convert it to text using (dataRow.GetCell(17) ?? dataRow.CreateCell(17)).CellStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("Text"); But if I try do…
jLynx
  • 1,111
  • 3
  • 20
  • 36
0
votes
1 answer

Clear Previous selection of Dropdown in EXCEL usingApache POI

I have developed the excel using the Apache NPOI dll using HSSFWORKBOOK. But in my excel having 3 dependent dropdowns one in each other. Here my question is I am unable to clear the cell value of dependent dropdowns. Let say like dropdown1 have…
0
votes
1 answer

How to read Excel to Datatable using NPOI C#

I'm Trying to read Excel to DataTable using NPOI.Every thing working fine but only issue is If we have any Column cell is empty in that row it is not reading .In Excel i have 4 row's with (each row have some empty values for cells). Excel File Image…
Anil kumar
  • 21
  • 1
  • 2
  • 3
0
votes
1 answer

NPOI border styles appear differently in macOS / iOS Preview

The following style var style1 = (XSSFCellStyle)workbook.CreateCellStyle(); var pink = new XSSFColor(new byte[] { 228, 52, 145 }); style1.SetBorderColor(BorderSide.TOP, pink); style1.BorderTop = BorderStyle.Medium; Renders correctly in Excel But…