Questions tagged [xssf]

XSSF provides Java APIs to read / write Microsoft Excel 2007 (OOXML format .xlsx) files. This tag should be used for questions about accessing Excel 2007 files from Java applications. XSSF is managed under the Apache POI Project. Other tag to consider: [tag:apache-poi]

HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (.xlsx) file format.

If you are starting with Apache POI, you may find the Busy Developer's link very useful: http://poi.apache.org/spreadsheet/quick-guide.html

Useful links

488 questions
0
votes
1 answer

Protect/freeze the position and size of image in xslx sheet using apache POI

I am creating an xlsx file using Apache POI in which a logo is inserted at the top left side. The issue is that, when ever the size of the cell is increased, the image also expands. How do I freeze or protect the image's size and position so that…
nidhi
  • 299
  • 3
  • 4
  • 21
0
votes
2 answers

Why do I get this NullPointerException with getCellType() if getCellType() is contained within a check for null?

I have a groovy script that is designed to export an Excel table to a markdown file. I am having an issue where getCellType() is throwing a null pointer exception. I have tried testing the cell to see if it is null in two places - both before the…
Blake Simmons
  • 426
  • 1
  • 8
  • 23
0
votes
1 answer

How to check type of Excel cell with XSSF

I'm trying to check if cell is numeric or empty. So I wrote this code ... int columnIndex = 1 while(columnIndex < numberOfColumns && matrixSheet.getRow(0).getCell(columnIndex).stringCellValue != '') { if…
Royce
  • 1,557
  • 5
  • 19
  • 44
0
votes
1 answer

Why only the last value is set during copy of excel content?

I'm trying to copy the content of an Excel file to another one. But only the first row. So, I wrote this code: // Step 1 : Locate path and file of input excel File inputFile = new File("path.xlsx") FileInputStream fis = new…
Royce
  • 1,557
  • 5
  • 19
  • 44
0
votes
1 answer

Apache POI: Why am I getting a null pointer exception with Cell.getCellType() within an if statement that doesn't occur if the cell is null?

I am creating a Groovy script to export tables from an .xlsm file to a .csv file including formulas when appropriate (rather than generated data). When the script calls .getCellType() on the current cell I get a null pointer exception, even though…
Blake Simmons
  • 426
  • 1
  • 8
  • 23
0
votes
2 answers

Trouble getting StreamingReader to work with Excel xlsx Java

This is the code that I have for reading a very large excel file (xlsx) that is 23.5MB with 700,000+ rows. String dir = rootPath + File.separator + "tmpFiles" + File.separator + FILE_NAME; File fisNew = new File(dir); Workbook w =…
posed1940
  • 23
  • 2
  • 6
0
votes
1 answer

Apache POI: Find out colspan of text overflowing to next column

I'm using Apache POI for converting Excel to HTML. I want the HTML table to be exactly as it appears in Excel. I see that many times there are cases where data in Excel cell overflows to next column. Is there a way to find out how many columns is…
Harpreet
  • 63
  • 6
0
votes
1 answer

Read Excel header and row value

I would need to read the excel content which has header and N.of rows. Based on column header input,the row needs to be extracted in JAVA. the java code which i has reads the full excel content. //Create Workbook instance holding reference…
TTT
  • 113
  • 2
  • 3
  • 11
0
votes
1 answer

How to create specific cellstyles with xssf in c# (NPOI)

I'm creating an excel xlsx file from scratch with NPOI in c#, and need to have specific cellstyles for each of my cells. But as far as i can tell, every time i change the cellstyle of one of my cells, it modifies another unrelated cell. Each time I…
Triterium
  • 13
  • 7
0
votes
0 answers

Java Apache POI 4.1 createPivotTable throwing "Cannot get a STRING value from a NUMERIC cell"

The problem originates when programmaticly creating pivot tables in .xslx file using the POI 4.1 library. Part of the upgrade of POI to 4.1 from 3.X is the removal of setting cell types. Thus in 4.X calling and setting of cell types is automatically…
0
votes
1 answer

What is the easiest way to count .xlsx workbook sheets using c#, NPOI and an XSSF workbook?

I am trying to count the number of sheets in a workbook. The workbook is created using NPOI and there doesn't seem to be a way to count the amount of sheets using the C# version of NPOI? This is a really tricky thing to both explain and show... But…
0
votes
1 answer

How to set relative path of Unix server folder to save/create Excel file

Currently I am using Apache POI to write output in Excel in my Java code here, I am saving this output Excel file somewhere in my local drive. Now challenge is, I have to save/create this same Excel on Unix server in some directory due to some…
priya
  • 45
  • 8
0
votes
1 answer

Apache POI XmlException for theme (http://purl.oclc.org/ooxml/drawingml)

Currently, I'm using Apache POI for reading an excel file(.xlsx) but encountering an exception during instantiation of XSSFWorkbook when passing the data stream. Below is the exception encountered. Apache Poi version: 4.0.1 Exception in thread…
Joey
  • 695
  • 6
  • 19
0
votes
0 answers

How to assign a format from a template MS Excel file to a cell in an Apache POI XSSFWorkbook?

In an Apache POI XWPFDocument (Word) I use this code to assign the user defined format MyHeadline to a new paragraph. MyHeadline is contained in template.docx which was created with LibreOffice. XWPFDocument document = new XWPFDocument(new…
Martin
  • 178
  • 10
0
votes
3 answers

convert excel double cell type to string type using POI

I am reading an excel which has some cells as double type. I want to read and print them as strings. My sample excel file has following data. Date|City|Credit|Debit|Balance|Type 10-01-2019|New…
Nads707
  • 1
  • 4