FAQ Database Discussion Community


Apache POI - Column having non-english characters e.g. Thai and cell empty, then skips the cell

excel,utf-8,apache-poi,cell
I am trying to read an excel file (.xlsx) using Apache POI. One of the column of the file has non-english characters in it e.g. บริษัท พัฒนา จำกัด (มหาชน) If the cell is having any value, then POI reads the cell properly with correct non-english characters. But, if the cell...

Cannot get a text value from a numeric cell “Poi”

java,selenium-webdriver,apache-poi
I'm trying to consume data from a spreadsheet in Excel, but always of this error, already tried formatting the worksheet to text and number and still the error persists. I saw a person using it resolved cell.setCellType ( Cell.CELL_TYPE_STRING ) ; but I do not know where I fit this...

poi working in eclipse but not tomcat

java,eclipse,excel,tomcat,apache-poi
I have updated jxl to apache poi 3.10.1. I have Eclipse juno, and I can run the app through that version of eclipse. However, when I try to run the app directly from tomcat the poi export does not work. I get the following error message. I have tried updating...

apache poi jar missing class files

java,excel,maven,apache-poi,missing-features
I just started using the Apache POI library for dealing with .xls and .xlsx files. I got the poi-ooxml-3.11.jar file from their maven repository and tried the example found here. When implemented in Eclipse, the import for the Row class was not resolved. I have checked the .jar file of...

Apache POI is extremely slow

java,excel,io,apache-poi
I have seen many questions online about Apache POI performance, but none of them is as slow as my case and none of their solutions works for me. I am using NetBeans 8.0.2, JDK 1.8 and POI-3.12-20150511. To read a 300 KB xls (with 3000 rows and a few columns),...

Reading Excel file using poi and shift it to two-dimensional array

java,excel,apache-poi
I am using POI to read excel file and convert it to a two-dimensional array. Following is code section: import java.io.FileInputStream; import org.apache.poi.ss.usermodel.CellValue; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class XlsxRead_2 { public XlsxRead_2(){ getvalue_1(); } public static void getvalue_1(){ XSSFRow row; XSSFCell cell; String [][] value...

Apache POI getRow() returns null and .createRow fails

java,excel,apache-poi
I have the following problem using Apache POI v3.12: I need to use a XLSX file with 49 rows [0..48] as a template, fill it's cells with data and write it out as a different file, so I can reuse the template again. What I am doing is approximately this:...

Apache POI XWPF does not replace but concatenates

java,apache-poi
I'm new with Apache POI and I'm having trouble replacing text. I copied my code here Replacing a text in Apache POI XWPF not working It works but it does not replace the text but concatenates it. So if I have "Quick brown fox jumps over" and replace "over" with...

How can I change charts generated by apache poi to not use smoothed lines and show empty cells as gaps?

java,charts,apache-poi
I am using POI 3.12-beta1 and have code that creates a line chart with multiple datasets and named series in the legend. However, the default settings for line charts in poi generate a line that has been smoothed over the data points. Empty values are also being plotted as 0,...

Apache Poi Problems setting up in command line

java,apache-poi
I am trying to make use of Apache-Poi for a program I am working on, but I recently ran into problems trying to actually implement it. I downloaded the files, and unzipped them, but my program won't recognize it. I have: tried adding the .jar files to the classpath tried...

How to add Data validation to entire column of an excel sheet using apache poi in java?

java,excel,apache-poi,data-validation
I have a requirement Where I need to add data validation to an entire column rather than a specific cell. I went through the documentation of Apache poi and found the example below HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("Data Validation"); CellRangeAddressList addressList = new CellRangeAddressList(0, 0, 0,...

How to get DataXML from Slide Diagram in Powerpoint using Apache POI

java,xml,apache-poi,powerpoint,openxml
I have added one smart art shape in the Microsoft power point presentation slide. I want to get the data of that diagram in Java using apache POI. How to retrieve the complete data.xml from first slide of presentation. I opened the presentation and following is the hierarchy of presentation....

How to Generate DataXML in OpenXML for powerpoint in java

java,xml,apache-poi,powerpoint,openxml
I have added one smart art shape in the Microsoft power point presentation slide. I have retrieved the data of that diagram in Java using apache POI. I want to generate my Own DataXML for that presentation from scratch using apache poi or any other free java API. How i...

parse part of xlsx file using poi xssf and sax parser

java,parsing,apache-poi,saxparser,import-from-excel
I am trying to read 10 rows out of 1 million records in an excel sheet (.xlsx) : FileInputStream myFile = new FileInputStream(file); OPCPackage pkg = OPCPackage.open(myFile); XSSFReader reader = new XSSFReader(pkg); MySheetContentHandler sheetHandler = new MySheetContentHandler(); StylesTable styles = reader.getStylesTable(); ReadOnlySharedStringsTable sharedStrings = new ReadOnlySharedStringsTable(pkg); ContentHandler handler = new...

Unable to upload excel file using spring + apache-poi

java,excel,spring,apache-poi
When I'm trying to upload excel file (.xls/.xlsx), then I'm getting following exception : org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process...

Matching Excel's floating point in Java

java,excel,floating-point,apache-poi,openxml
I have an .xlsx spreadsheet with a single number in the top-left cell of sheet 1. The Excel UI displays: -130.98999999999 This is visible in the formula bar, i.e. not affected by the number of decimal places the containing cell is set to show. It's the most accurate number Excel...

Exception when open xls files

java,excel,exception,apache-poi
I have a xls file which i can open in excel, but when i try to open it with Apache POI, i get this exception : java.io.IOException: block[ 3 ] already removed - does your POIFS have circular or duplicate block references? at org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:89) at org.apache.poi.poifs.storage.RawDataBlockList.remove(RawDataBlockList.java:34) at org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:221) at...

code for when you run a Data Driven [closed]

java,selenium-webdriver,apache-poi
When performing data driven in a given field , the code for its implementation , not running the next step of the code. //poi WebElement searchbox = driver.findElement(By.name("simcard")); try { FileInputStream file = new FileInputStream(new File("C:\\paulo.xls")); HSSFWorkbook workbook = new HSSFWorkbook(file); HSSFSheet sheet = workbook.getSheetAt(0); for (int i=1; i <=...

XSSFWorkbook poi: adding image IOUtils toByteArray unfined error

apache-poi,xssf
To insert image to excel using POI:XSSF I am using maven poi dependency: <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.8</version> </dependency> AND code as : InputStream my_banner_image = new FileInputStream("input.png"); byte[] bytes = IOUtils.toByteArray(my_banner_image); int my_picture_id = wb.addPicture(bytes, Workbook.PICTURE_TYPE_PNG); I am getting these errors: 1) The method toByteArray(InputStream) is undefined for the type...

getting incorrect value from excel using apache poi

java,apache-poi
in excel the value of column is 10101101010000000000 but when im reading it in java using POI the value is changed to 10101101009999999000, can anyone give me an idea on whats going on and how can i get the exact values from the excel. i've tried setting the celltype as...

Creating new sheet using Apache POI removes all the existing sheets

java,apache-poi
I trying to add new sheet to an existing excel file using Apache poi library as in the below code. FileOutputStream fileOut = new FileOutputStream(new File(BASE_PATH+outputFile)); Workbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet("Splitted Rules"); Set<String> tags = outputRules.keySet(); int i = 0; for (String tag : tags) {...

exception while using excel workbook

java,excel,apache,apache-poi
I am getting these exceptions in my code while i m writing some data in excel workbook using poi jars: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/UnsupportedFileFormatException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at...

Identifying Bullets in Ms Word, using Apache POI

java,java-ee,ms-word,apache-poi
I'm trying to make an application which would read a word file (docx) and do some stuff with it. So far, I've done pretty much everything except for to identify bullets. I can find isBold(), isItalic(), isStrike() but I cannot seem to find isBullet() can anyone please tell me how...

Java apache poi error: java.lang.IllegalArgumentException: Unknown error type: -60

java,excel,apache-poi
I'm getting error java.lang.IllegalArgumentException: Unknown error type: -60 , in following code: ... evaluator.evaluateFormulaCell(c); ... In excel file, all formulas works fine. Stacktrace: java.lang.IllegalArgumentException: Unknown error type: -60 at org.apache.poi.ss.usermodel.FormulaError.forInt(FormulaError.java:131) at org.apache.poi.xssf.usermodel.XSSFCell.setCellErrorValue(XSSFCell.java:611) at org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.setCellValue(XSSFFormulaEvaluator.java:203) at...

NoClassDefFoundError: UnsupportedFileFormatException while using apache poi to write to an excel file

java,excel,apache-poi,writing
I am trying to write to an excel(.xlsx) file using Apache poi, I included the apache poi dependencies in my pom.xml file. But I am getting the following exception in execution. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/UnsupportedFileFormatException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at...

Dandelion datatables exporting to Excel - missing export links

spring,datatables,apache-poi,thymeleaf,dandelion
I've asked question on Dandelion forum but I did not recieve any answer so I am trying here. AFAIK the creator of Dandelion answers here as well so maybe I will be lucky this time. My stack is Spring 4, Thymeleaf and Dandelion Datatables 0.10.1. What I am trying to...

How to read | separated csv file in java? [duplicate]

java,csv,apache-poi
This question already has an answer here: Calculating Average from a CSV File 4 answers I have pie | separated csv file. I want to read this file in java. I have a java code which read comma separated file in java but it fails at | separated csv...

Cannot create new excel sheet in a workbook using apache POI

java,excel,apache-poi
I am trying to copy multiple files in a singe excel file. Each sheet in that excel file will carry contents of one file. And there are around 6 files that I need to copy. So the resultant file should contain 6 sheets. But when I run my code only...

How to know the Image or Picture Location while parsing MS Word Doc in java using apache poi

java,apache,ms-word,apache-poi
HWPFDocument wordDoc = new HWPFDocument(new FileInputStream(fileName)); List picturesList = wordDoc.getPicturesTable().getAllPictures(); The above statement gives the list of all pictures inside a document. I want to know after which text/position in the doc the image will be located at?...

Java POI - read date from Excel file

java,apache-poi
I want to read the date (yyyy-MM-dd) in Java POI. Cell cell = cellIterator.next(); cell.setCellType(Cell.CELL_TYPE_STRING); switch(cell.getCellType()){ case Cell.CELL_TYPE_STRING: if(DateUtil.isCellDateFormatted(cell)){ [ERROR HERE] System.out.print(cell.getDateCellValue() + "\t\t"); }else{ System.out.print(cell.getStringCellValue() + "\t\t"); } case Cell.CELL_TYPE_NUMERIC: System.out.print(cell.getNumericCellValue() + "\t\t"); break; case Cell.CELL_TYPE_BOOLEAN: System.out.print(cell.getBooleanCellValue() + "\t\t"); break; } However, I...

java apache poi (part 2)

java,apache-poi
cont. on java apache poi (part 1) Code ... while(rowIterator.hasNext()){ List<String> record = new ArrayList<String>(); row = (XSSFRow)rowIterator.next(); Iterator<Cell> cellIterator = row.cellIterator(); while(cellIterator.hasNext()){ cell = cellIterator.next(); cell.setCellType(Cell.CELL_TYPE_STRING); switch(cell.getCellType()){ case Cell.CELL_TYPE_STRING: record.add(cell.getStringCellValue()); break; case Cell.CELL_TYPE_NUMERIC: record.add(Double.toString (cell.getNumericCellValue())); break; } } readFile(); }...

Open xls and xlsx with Apache POI

java,excel,apache-poi,xls,xlsx
I want to open my excel file with Apache POI. I don’t know if a file is xls or xlsx. I have only something like this: InputStream myExcelFile = new ByteArrayInputStream(file.getData()); This way I can open xls file: HSSFWorkbook hsf = new HSSFWorkbook(myxls); And this way I can open xlsx...

merging xlsx files in java

java,nullpointerexception,apache-poi
i m trying to merge two .xlsx files to each other in java. But i m somehow getting a NullPointerException on the line if (cell.getSheet().getWorkbook() == mcell.getSheet() .getWorkbook()) { } Any ides what could cause this error ? when i tried before merging other two files, my code worked perfectly,...

XSSFSheet.shiftRows error

java,excel,apache,apache-poi
I want to use shiftRows() for an xlsx file, but I get the following error message, even though I have imported "org.apache.poi.ss.formula.FormulaShifter;" properly Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.apache.poi.ss.formula.FormulaShifter.createForRowShift(IIII)Lorg/apache/poi/ss/formula/FormulaShifter; The shiftRows() does shift the rows of my file; but after that, the program doesn't run the other commands. Here is...

Password-Protect .XLS Excel files using Apache POI

java,excel,apache-poi
I am using Apache POI 3.11, which is supposed to support password-protecting Excel files (both XLS and XLSX types). I was easily able to get encrypting of the XLSX type to work properly using POI, but I have been unable to do this with the old XLS type. I have...

Exporting data to excel from java

java,excel,apache-poi
I'll try my best to explain my problem so I apologise if parts of this post is confusing. I have two columns of data that looks like this:- There's just over 6000 rows. What I want to do is to take the difference between each mz value whose rt value...

NoClassDefFoundError: UnsupportedFileFormatException while working with excel sheet using java

java,excel,apache-poi,xlsx,xssf
I'm writing a Java program which reads from a .xlsx file and give the output in .csv format. This is my code: import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Iterator; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.ss.usermodel.Cell;...

Need suggestions regarding the .doc file reading in android

android,apache-poi,document,docx4j
I'll be working on a new app that reads the .doc and .docx files and get the number of words, no of lines, no of pages, no of images, no of formula's so so from the particular word document. So, i used the Java Scanner class to get the word...

“Your InputStream was neither an OLE2 stream, nor an OOXML stream” while reading .xslx File

java,excel,apache-poi
I want to read Excel files which I get passed over REST as InputStream. For this I have the class ExcelImport: import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException;...

Unable to open excel file. Throws “Unreadable format” error

java,string,excel,apache-poi
I am actually trying to copy a String[]into excel. Code is something like this. int ExRows = 2, ExCols = 2; XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet xs = wb.createSheet("Sheet"); try { String[] inputArr = {"Gender", "Age", "Male", "45"}; int val =0; for(int i =0;i<ExRows;i++){ XSSFRow row = xs.createRow(i); for(int...

Excel formatting with Java Apache POI

java,excel,formatting,apache-poi
I have an excel file in the following format: I would like to restructure this format and have it outputted in the following format: The sections are repeating and can appear in any order but they will have either format. The 'Check' column is sometimes merged across rows as shown...

Not able to write excel row column (apache poi) by multiple for loop

java,excel,apache,apache-poi
I have a xlsx file which has multiple sheet i am using apache poi for writing excel, in sheet2 i have 2 columns each column i want to populate by running a for loop , but i see that only last for loop get written previous one get blank in...

Reading Powerpoint SmartArt in Java

apache-poi,powerpoint,openxml
I found Apache POI doesn't support reading SmartArt component. (Am I right?) So I tried Aspose.Slides and it worked. But the trial version has critical restriction. (can't get text has length over 5 characters) Can anybody help?...

NPOI: Create a cell containing two differently sized strings

c#,excel,apache-poi,string-formatting,npoi
so as the title intends, I want to creaete a cell in a NPOI 2.1.3-Workbook containing 2 strings: A "normal"-sized string and a "small"-sized string. => I want to change the font-size for a part of the cell. My code so far: var planCell = planRow.CreateCell(lineCnt + 1); var planCellStyle...

How to add table heading drop-down with Apache Poi

java,apache-poi
I'm generating Excel tables with Apache POI, but my generated tables lack the drop-down menu on each header that appear when I "format as table" in Excel itself. I'd like to generate this: But instead I get this: I'm following this blog post, and my code looks like this: XSSFTable...

Insert image in column to excel using Apache POI

java,apache,apache-poi
I'm trying to insert an image into a cell in excel. I've added pictures fine, but I still runs anywhere. I want to say that I want this column.

XSSFWorkbook, XSSFSheet not working - NetBeans 8.0.2

java,apache-poi,netbeans-8,xssf
I downloaded the POI 3.11 package from the Apache repositories website, added them to my project. After that I added xmlbeans, ooxml-schemas, but still my NetBeans 8.0.1 IDE shows an error when I declare XSSFWorkbook and XSSFSheet. Can anybody help me here as I am not much of a core...

Java Program using Apache POI giving me weird Exceptions

java,apache,netbeans,apache-poi
I am having some serious difficulty getting my project off the ground. I have the following code: FileInputStream file = new FileInputStream(new File("src/retestchecker/test_sheet.xlsx")); //Get the workbook instance for XLS file XSSFWorkbook workbook = new XSSFWorkbook(file); //Get first sheet from the workbook XSSFSheet sheet = workbook.getSheetAt(0); Row row = sheet.getRow(0); Cell...

How do I set a new cell after the last existing column?

java,apache-poi
I need to set a new column called Status after the last existing column, but my code is some columns before and using getLastColumn displays nothing. How do I set a new cell after the last column ("Link especificação")? private Workbook setStatus(Workbook wb, Map<String, Integer> header, List<ValidacaoResultado> validation, Planilha planilha)...

how to get the inputStream from Workbook object in java

java,excel,apache-poi
When I upload the file i am passing the inputstream to the workbook. Now I want to use this InputStream from workbook in another method like save where I save the file InputStream in to DB. Here is my code. public void FileUpload(FileUploadEvent event) throws ParseException { UploadedFile item =...

How to read excel data into vector table

java,excel,jsp,exception,apache-poi
Sorry, im new to java. I have changed the method from JXL to Apache POI to read excel file. Now im struggling with the java code. i can get the return output from my vector dataholder it listed all the details from the excel file row by row. Please, need...

NullPointerException when accessing a cell with Apache POI

java,excel,apache-poi
I am trying to read an Excel file with Apache POI. My goal is to get the cells 2 & 3 from every row and place them into an array. In some rows cell number 3 is empty (I am not talking about EMPTY, NULL or BLANK). Just empty if...

CellStyle dataformat for XLSX

java,apache-poi,export-to-excel,xssf,poi-hssf
I have some code like : CellStyle cs2 = wb.createCellStyle(); CellStyle cs4 = wb.createCellStyle(); cs4.setDataFormat(HSSFDataFormat.getBuiltinFormat("CELL_TYPE_NUMERIC")); cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text")); this is for creating xls reports. How do i change this code to create XLSX reports ? will the following work ? XSSFDataFormat format = (XSSFDataFormat) wb.createDataFormat(); cs2.setDataFormat(format.getFormat("text")); Please help. Thanks...

Apache POI characters run for .docx

java,api,apache-poi,document,docx
In .doc files, There is a function to get each character in paragraph by using CharacterRun charrun = paragraph.getCharacterRun(k++); and then I can use those character runs to inspect their attributes like if ( charrun.isBold() == true) System.out.print(charrun.text()); or something like that. But with .docx files seems to have no...

POI ignoring some snippets of docx

java,xml,apache-poi,docx
I'm trying to use this code (POI 3.11) to extract text from a docx file: XWPFDocument doc = new XWPFDocument(OPCPackage.open("sample.docx")); for (XWPFParagraph p : doc.getParagraphs()) { List<XWPFRun> runs = p.getRuns(); if (runs != null) { for (XWPFRun r : runs) { String text = r.getText(0); System.out.println(text); } } } Here...

POI - Can't open xslx files in osgi

java,excel,osgi,apache-camel,apache-poi
Getting the next exception when trying to read xlsx files in osgi (jboss-fuse). Xls is working fine. Using the next jar files inside the bundle : <br> lib/xml-apis-1.0.b2.jar, \<br> lib/poi-scratchpad-3.9-20121203.jar, \<br> lib/poi-3.9-20121203.jar, \<br> lib/dom4j-1.6.1.jar, \<br> lib/poi-ooxml-schemas-3.9-20121203.jar, \<br> lib/poi-ooxml-3.9-20121203.jar, \<br> lib/xmlbeans-2.3.0.jar, \<br> lib/poi-excelant-3.9-20121203.jar, \<br> lib/xmlbeans-xpath-2.3.0.jar <br>...

Need to write Results in Xls

java,apache-poi
I need to write test cases name and results in xls file or csv file. I have Used an existing file and writing the result in existing file it returns NULL pointer exception on line * cell=row.getCell(0); * Given below my code.. package com.testCases; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap;...

Apache POI XSSFFont getBold() give null pointer exception

java,apache,apache-poi,xlsx,xssf
I'm trying to check whether the font in excel is bold or not.I kept getting a null pointer exception everytime I run the code. XSSFSheet sheet1 = workbook.getSheetAt(1); XSSFRow row1 = sheet1.getRow(1); XSSFCell cell4 = row1.getCell(4); XSSFRichTextString val = cell4.getRichStringCellValue(); System.out.println(val.toString()); XSSFFont f = val.getFontAtIndex(0); System.out.println(f.getBold()); <--- this line is...

Excel processing throws exception 'NoSuchMethodError' on Formula Evaluator for .xlsx file

java,apache-poi
I have a problem while processing excel files. Processing of excel is working fine for .xls file. But it throws the following exception when it process .xlsx file on the Formula Evaluator. Is there a common method to get Formula Evaluator for .xls and xlsx or need to write seperate...

Read multiple excel file and push data to respective object in java, looking for efficient way

java,excel,apache-poi
I have multiple excel file, using apache poi library I can read each excel file and set the data to object. for example, employee.xls: emp.id firstname dob 111111 fName 19/10/2011 222222 tName 11/12/2010 and the object as below: class Employee { private String empId; private String firstname; private Date dob;...

Getting specific data from an excel sheet JAVA

java,excel,apache,apache-poi,xssf
I am trying to get specific data from an excel sheet, The data is dynamic. It can be anything really. The column headers are the only things i can use for placeholders, but the column header positions can vary in the sheet. For example i have a sheet like this...

setCellValue is deprecated

java,excel,apache-poi
In my project, I am adding the functionality of generating Excel file using Apache Poi library in a Spring project, using the below code. public class ExcelView extends AbstractExcelView { @Override protected void buildExcelDocument(Map model, HSSFWorkbook workbook, HttpServletRequest request, HttpServletResponse response) throws Exception { List<Employee> employees = (List) model.get("employees"); HSSFSheet...

Apache poi XWPFRun doesn't have isDoubleStrikeThrough method

java,ms-word,apache-poi
Now i'm using poi 3.11. org.apache.poi.hwpf.usermodel.CharacterRun (for *.doc files) has both isStrikeThrough() and isDoubleStrikeThrough(), but org.apache.poi.xwpf.usermodel.XWPFRun(for *.docx files) has only isStrike() method. Why? it seems that isStrike() method can't detect double-struck state. i know that double-struck state can be detected with this implementation below instanceOfXWPFRun.getCTR().getRPr().isSetDstrike() but it is not pleasant...

apache poi indexoutofbound exception

java,apache-poi
Excel File (test1.xlsx) Name     Gender     Age     Resign Date Ali              M           20 Abu            M          25...

How to apply bold text style for a range of text inside a cell using Apache POI?

java,excel,apache-poi
How to make a range of text bold text style using Apache POI? Eg: Instead of applying style for the entire cell. I used to do this in vb.net with these lines of code: excellSheet.Range("C2").Value = "Priority: " + priority excellSheet.Range("C2").Characters(0, 8).Font.Bold = True But I can't find the way...

Writing to Excel File using hash map

java,apache-poi
Hi,I'm getting exact values from hash map but my Apache POI Row and Cell cannot set values properly expected result like that please let me know.Thanks I'm getting result hash-map like that: {1=[ACSS Description1, ACSS Description2, ACSS Description3, SACSS Description4], 2=[11, 1, 4, 12]} I'm expecting: I'm getting result...

Why can't set a value for a row and column with the Apache POI?

java,excel,apache-poi
I need to set a value for a specific row and column of the spreadsheet, but I get a null pointer before even i = 1. I've tried changing the code but this error keeps happening and I have no more idea why.Does anyone have any idea why this happens?...

How to Export an HTML table as an Excel while maintaining style and applying freeze pane

java,html,excel,apache-poi,jsoup
I am working on a project where an export to Excel functionality is required for a specific HTML table. The tables style needs to be maintained. Also, a metadata section needs to be added to the Excel (not present in the html table) and this section needs to be frozen....

Apache POI Anomalous Whitespace (Resolved: \u00A0 non-breaking space)

java,apache-poi
EDIT: Resolved Answer: Was a 00a0 nonbreaking space, not a c0a0 nonbreaking space. After using Apache POI to convert from docx to plaintext, and then reading the plaintext into Java and trying to parse it I've run into the following problems. Output: " " first characterequals SPACE OR TAB false...

getCellType() of Poi throws NullPointerException, when cell value is blank

java,selenium-webdriver,apache-poi
I have used the following code to print all the values from an Excel spreasheet using POI. It works fine, when there is value in all the cells. However, if there is Blank cell it throws a NullPointerException. I observed that getCellType() method throws this exception. Can you please help...

Reading an excel and calculate total using Java/Apache POI

java,apache-poi
Scenario: I am working on an application which would open an excel file, iterate the rows of a worksheet and calculate the total of numeric values of each row. Question: Consider the following 2 cases: If the output for the first case is: A -> 15.0 pages. B -> 15.0...

Java Null Pointer Exception for Apache POI in reading cell data for CSV conversion

java,excel,apache,apache-poi,xls
I'm trying to do two things for this application:one when the class is called upon, it will run from top to bottom and two, I can call the public method "xlxTOcsvConverter" and supply the three needed parameters for future use...that said, if the class is run, 4 files will be...

how can i add poi jar file to android studio 1.0.1

android,jar,gradle,apache-poi
I'm working on android studio 1.0.1 and am unable to add poi.jar file to the project correctly. I added poi-3.9.jar to app/libs file and synchronised the project, however running the project gives this error: failed to complete gradle execution ...

How to create a circle using GeneralPath and apache POI

java,awt,apache-poi,powerpoint
How to create a circle using GeneralPath and apache POI. I want create any circle in a MS PowerPoint Slide. I user appache POI in Java program. String exportFile = "pptx/export.pptx"; XSLFSlide[] slides = ppt.getSlides(); XSLFSlide slide = slides[0]; int x=300; int y=400; int R=50; java.awt.geom.GeneralPath circle = new java.awt.geom.GeneralPath();...