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
1
vote
1 answer

NPOI how to resize picture

I can place the image into the excel but it takes up cells A1 to around 3/4 of D12. I tried searching up ways to resize the image but most of the links provided were deleted from previous users. My goal is to put the image into the cell A1 and…
1
vote
1 answer

C# NPOI library missing?

I'm having trouble with understanding what to replace Workbook with as it keeps getting the error "doesn't exist in the current context. I'm not sure if it has to do with me missing a library or carelessness. using NPOI.HSSF.UserModel; using…
1
vote
0 answers

Ruby on Rails Excel file formula calculate without any manual interaction

Am trying to use selenium webdriver in ruby on rails for import test case but most of my Excel file has "=Now()" formula so when without open and save that file manually i try to import it showing old date only Actually am unable to use below…
SENTHU SOFT
  • 19
  • 2
  • 8
1
vote
2 answers

Why does not XSSFRichTextString.applyFont() work as it is written in java doc?

I am trying to apply bold font on parts of a string and place it in a cell. XSSFFont font = workbook.createFont(); font.setBold(true); XSSFCellStyle style = workbook.createCellStyle(); style.setFont(font); XSSFCell c =…
1
vote
1 answer

Load a large xlsx file from INPUT-STREAM throwing OutOfMemoryError Apache POI

I want to read a large excel-file(.xlsx/.xls). When I upload a 20MB file, suddenly Java-Heap was increased by 2GB and ran into OutOfMemoryError. private Sheet getSheetForFileType(String filType, InputStream fileData) throws IOException { …
Pawan
  • 301
  • 2
  • 9
1
vote
0 answers

XSS Cross site scripting doesn't allow xls file in spring boot application

I am using XSS cross site scripting in my application. My application has an endpoint where I have to upload a xls file through postman. When I try to hit the endpoint, the XSS scripting doesn't let it pass and gives following error 2019-08-08…
Bhanu Mittal
  • 61
  • 3
  • 11
1
vote
0 answers

How to add table format into Excel sheet

I am trying to add table format after writing data into sheet. I came across this blog which has POI not NPOI implementation. So I tried writing slimier in C#. Code I tried: XSSFTable my_table = ((XSSFSheet)sheet).CreateTable(); CT_Table cttable =…
Prem
  • 316
  • 1
  • 5
  • 23
1
vote
0 answers

How to disable pivot tables reading for Workbook creation

I use apache poi. I want to get object of Workbook class using following code. Unfortunately WorkbookFactory tries to read pivot tables cache that causes error. Is it possible to disable reading pivot tables? How to do this in apache poi. Thank you…
falcon
  • 85
  • 1
  • 2
  • 8
1
vote
2 answers

Why "cellIterator.hasNext()" is getting "TRUE" even though cell has empty value

consider below screenshot of my excelSheet Now consider below code, which will iterate every row then iterate every cell and then print cell value. public void excelData2(int sheetNo) { Iterator rowIterator =…
Jagadeesh
  • 358
  • 5
  • 17
1
vote
0 answers

how to add shapes in word document using apache poi library

I need to add below shapes available in MS word using Apache poi library. I am not able to find any specific class/method available for word to add such shapes. However, I can find some method to add shapes in excel from apache. XSSFDrawing…
Arvind
  • 46
  • 9
1
vote
1 answer

Does NPOI support copying a worksheet and inserting it into the same workbook?

I'm new to using NPOI and the XSSF interfaces. Does NPOI XSSF support copying a sheet and inserting it into the same workbook? From reading, I see that through HSSF I can copy a sheet and insert it into a new workbook. I know that Aspose.Cells…
JohnB
  • 3,921
  • 8
  • 49
  • 99
1
vote
2 answers

How to write a list of data in excel in column wise using Java?

I have a list of data in ArrayList which contains the heading as well as the values associated with it. Like below, Fruits Apple Orange ****** Vegetables Beans Carrot Brinjal Cucumber ****** Colors Orange Blue Red Green Yellow Now, I want to…
Arosh Kumar
  • 13
  • 1
  • 4
1
vote
1 answer

FreeMarker: left-hand operand: Expected a hash, but this has evaluated to a number (wrapper: f.t.SimpleNumber)

I am using freemarker 2.3.28 and trying to assign a value to a variable but I get the error in the title <#list 0..row.getLastCellNum()-1 as cell> <#assign cellValue = cell.getStringCellValue()> <#assign cellAddress =…
sticky_elbows
  • 1,344
  • 1
  • 16
  • 30
1
vote
1 answer

Apache POI encrypted xlsx cannot be opened in excel

I'm trying to create an encrypted xlsx file using Apache POI. Here's my code, which runs just fine: public static void Encrypt(String data) throws IOException, GeneralSecurityException, InvalidFormatException { Workbook wb = new…
Daniele Cervi
  • 75
  • 3
  • 11
1
vote
1 answer

XSSFCell causing lock while setting value when running with huge data

I am writing a huge data to Excel sheet. I am using XSSFWorkbook for excel creation. For 20,000 rows the excel write is fine. But when I try to write a data of more than 1 Million ,the excel sheet is not coming out for more than 3 hours. When I…
user2699067
  • 33
  • 2
  • 8