I’m having problems trying to open an XLSX file with Apache POI. My code: Exception thrown: Background: Running JDK 7 on MacOS X (Mavericks) Using NetBeans Imported jars (all from Apache POI binary distribution): poi-3.11-20141221.jar poi-ooxml-3.11-20141221.jar poi-ooxml-schemas-3.11-20141221.jar commons-codec-1.9.jar log4j-1.2.17.jar I can’t even start doing the real stuff, since I can’t even open the book! 🙁 When I saw the exception,
Tag: apache-poi
Format number with thousands separator in Excel using Apache POI
I want to format some number cells, with a comma as thousands separator. For example: I have the following code. What should I use as formatStr? Is there an easy way? Or do I have to detect the number of zeros in order to produce something like this #,###,###? Keep in mind that I’m dealing with numbers. The cell type
Is there any way to create a Pivot Table in Excel using Apache POI?
I am currently working on the automation of Excel, and add such I have made a good use of the Apache POI library. As I have so much data stored in my excel workbook in various columns, that I’m trying to create a pivot table. Is there any way to create Pivot tables using POI ? My requirement is that
I am trying to combine multiple csv files into one excel workbook as different sheets using java
I am able to create the sheets for different .csv files present in a folder in one Excel workbook using below java code But i am getting the data of all the csv file data in to single worksheet. i am unable to get the data same as the orginal .csv files into specified sheets Answer
Apache POI – setting left/right print margin in Excel
Is that possible – with apache POI – to set left or right print margin for Excel sheet? The default margins are quite big. I cannot see neither setLeftMargin nor setRightMargin in XSSFPrintSetup, but only header and footer: Is there any kind friend that could help me a little? Answer The sheet margins are not contained in the XSSFPrintSetup object,
Using Apache POI how to read a specific excel column
I’m having a problem in excel while using Apache POI. I can read across rows, but sometimes I’m in a situation where I would like to read a particular column only. So is it possible to read any particular column like only the ‘A’ column only or the column ‘C’ only. I’m using the Java language for this. Answer heikkim
Multiline text in Excel cells
I’m trying to write multiline text to excel cells. But when I open the document, I see only one line until I double-click it for editing, then it becomes two-lined. Why is it so? Thanks Answer You need to set the row height to accomodate two lines of text. You need to set the wrap text = true to get
Limitation while generating excel drop down list with Apache POI
I’m trying to generate an excel file with some validations, I’ve read the poi dev guides for implementing it. During implementation, I got an exception (String literals in formulas can’t be bigger than 255 characters ASCII). POI concatenates all drop down options into ‘0’ deliminated string and checking its length and giving me exception. 🙁 I’m using latest version of
How to convert HSSFWorkbook to XSSFWorkbook using Apache POI?
How to convert to in Apache POI? Environment : JSE1.6 JBossAS 4.3.2 POI 3.7 Answer this code has been adapted from what I found here on coderanch forum
How to get the formatted value of a number for a cell in Apache POI?
I wanted to get the value of a Numeric cell as a simple string. Suppose there the type of cell is numeric with value 90%. Now I cannot use cell.getStringCellValue() as it will throw exception. I also …