Tag: java

getting xmlvaluedisconnectedexception error when saving xlsx file java poi

save.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String excelFilePath = “sample.xlsx”; FileInputStream inputStream = null; try { inputStream = new FileInputStream(new File(excelFilePath)); } catch (FileNotFoundException e1) { e1.printStackTrace(); } Workbook workbook = null; try { workbook = new XSSFWorkbook(inputStream); } catch (IOException e1) { e1.printStackTrace(); } //Sheet sheet = workbook.getSheetAt(0); for (int i = […]

Export Data to Excel in Java

Im having java code to make calculation for mathematical formula , and i wanna to export it to excel sheet , but when i do that the value the came from the calculation it become +1 and i don’t know how to fix this , so please can you help me guys , below you […]

Extract text from Office and PDF files in Java

I have a list of .pdf, ppt, pptx, xls,xlsx, doc and .docx FilesList<File> and now want to look for email-addresses in this files. My Problem is how to extract the plan Text smart from those files. Currently I am using Apache POI and I have a single methode for every type of File is there […]

Convert Java date to Excel date results in one more day than actual, before March 1, 1900

I am using POI to export some data into an Excel file. I have some code to insert some date into Excel sheet cell as date (rather than text). I works fine for dates after 01/03/1900. However for dates before that, it results a dates one more day than actual day. //SOME CODE final HSSFDataFormat […]

No suitable JDBC Excel driver is found in exported runnable .jar file

I’ve written J2SE application that uses connections with Excel spreadsheet and Oracle. I’m using xlsjdbc-1.7.0.jar drivers for Excel connections. It runs fine from Eclipse, but when I build a runnable .jar file and try to execute it on other PC, it shows following error: No suitable Driver found

Read Expand and Collapse in Excel

I have a excel with the Expand and collapse option with + and -. Is there a way to read that value while reading the excel file in java? Can i know whether there is a expand or collapse present for that particular row when am reading it in my Java code? Like in the […]

How to unzip the “Password Protected xlsx file” using java

I am using java.util.zip package to unzip the xlsx files and using Stax parser for reading the data. Is it possible to unzip the password protected xlsx file using the java.util.zip package. When I try this I am not able to get the sheet.xml files , I can able to see only the encrypted folders.

Reading data and inputting it into a new Excel file using Java POI

I am Currently trying to read an excel file in java, modify it and then place it into a new excel file. At the minute im just trying to place the read data straight into a new file. My question is how would you get the content from cell.getContents() straight into the new file if […]

Selenium Webdriver: Getting Nullpointerexception while reading an .xls file and unable to read it

I am trying to get data from the .xls file but when it tries to read sheet from .xls file, it throws nullpointerexception. Exception in thread “main” java.lang.NullPointerException at lib.ExcelDataConfig.getData(ExcelDataConfig.java:31) at data.ReadData.main(ReadData.java:15) Following is my code: 1. ReadData.java public class ReadData { /** * @param args */ public static void main(String[] args) { String path=System.getProperty(“user.dir”); […]

How to add default values to a excel cell if user do not enter any values using Java?

I am creating an excel sheet and writing data into it. And I will be reading that excel sheet in another program. Now user can update the data present into the excel sheet. But if user removes present data and don’t add any values in that cell then excel should add default values automatically. How […]

MS Excel Spreadsheet is the best Office Software, Excel VBA and Excel Formulas make Spreadsheet work faster.