apache-poi

How to copy a Excel Sheet into another Workbook using Apache POI for Java?

房东的猫 提交于 2020-01-24 20:51:06
问题 I am trying to copy a Excel sheet into another Excel Workbook. All the possibilities I found browsing the web won't work with formulars. The best code I found: http://www.coderanch.com/t/420958/open-source/Copying-sheet-excel-file-excel Do you have any ideas how I can get this to work? Thanks, Lomin Edit: Added the Code: import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf

May I use jxls and apache poi together?

☆樱花仙子☆ 提交于 2020-01-24 12:41:10
问题 I'm making an application to analize some data and the result must be presented in excel files. In that sense I started to use Apache POI (3.11). Due to some reports consumes a lot of time and memory to be reproduce, I made an investigation and I found jxls, after some test I thought was the solution. But now I found a problem: can´t work both frameworks together. I have to update Apache POI from 3.11 to 3.14, in order to work with jxls-2.3.0 I made an extra package in order to make my tests

How to set comments for 3 cells using apache poi

有些话、适合烂在心里 提交于 2020-01-23 15:25:31
问题 I want to set comments for 3 excel cells using Apache POI. This is my source code: import java.io.*; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.HSSFColor; public class CellComments { public static void main(String[] args) throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Cell comments in POI HSSF"); HSSFPatriarch patr = sheet.createDrawingPatriarch(); HSSFCell cell1 = sheet.createRow(3).createCell((short)1); cell1

How to set comments for 3 cells using apache poi

给你一囗甜甜゛ 提交于 2020-01-23 15:22:09
问题 I want to set comments for 3 excel cells using Apache POI. This is my source code: import java.io.*; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.HSSFColor; public class CellComments { public static void main(String[] args) throws IOException { HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("Cell comments in POI HSSF"); HSSFPatriarch patr = sheet.createDrawingPatriarch(); HSSFCell cell1 = sheet.createRow(3).createCell((short)1); cell1

How to write JSON data into excel or csv format Android?

泪湿孤枕 提交于 2020-01-23 04:26:28
问题 I am trying to dump my JSON response into excel sheet with .csv file after getting response from server. I have tried with poi-3.7.jar and poi-ooxml-3.11.jar libraries. But I am getting an empty excel sheet. Please check my below code for more reference. My JSON URL http://vehiclerescue.in/ideadarpan_beta/api/reportApp/get_tsm_data Code how I created rows: try { fis = new FileInputStream(new File("C:\\File\\excel.xlsx")); workbook = new XSSFWorkbook(fis); sheet = workbook.getSheetAt(0); /

POI Formula Evaluater IFERROR

放肆的年华 提交于 2020-01-23 03:29:06
问题 I am using POI 3.8 to read the excel i am using User model api of POI which is capable of reading HSSF and XSSF both but there is some problem in evaluating the fomula POI 3.8 doesnt support the IFERROR function of Excle is there any alternate and i dont want to convert the formula to ISERROR caz it not supported by older version of excel. I know POI 3.8 doesnt support IFERROR but what can i do to make it done -- Thanks in advance os this Following is the Exception Exception in thread "main"

How to Group date Column (to date ,month and year) in Excel Pivot Table using Java Apache POI?

£可爱£侵袭症+ 提交于 2020-01-23 03:17:06
问题 i am developing an application using Java apache POI that integrate with Excel to create Pivot table for some data in xslx file extension using XSSFWorkbook and i have date column that contain date values like this "1/8/2016" and i want to grouping this column in this pivot table into day , months and years like that using java Apache poi so any help ? 来源: https://stackoverflow.com/questions/38747773/how-to-group-date-column-to-date-month-and-year-in-excel-pivot-table-using-ja

How do I check if a cell contains an image using Apache POI?

你。 提交于 2020-01-23 02:26:11
问题 I have the following block of code: File file = new File("myFile.xlsx"); // my file inputStream = new FileInputStream(file); System.out.println("reading"); XSSFWorkbook wb = new XSSFWorkbook(inputStream); XSSFSheet sh = wb.getSheetAt(0); // first sheet Iterator rowIter = sh.rowIterator(); while(rowIter.hasNext()){ // iterate over all rows System.out.println("New Row "); // notify of new row Row myRow = (Row) rowIter.next(); Iterator cellIter = myRow.cellIterator(); while(cellIter.hasNext()){

Display Excel sheet in the Browser?

北城余情 提交于 2020-01-22 22:12:48
问题 I need to display the newly generated excel (from tables using Apache POI) in a web browser (whatever it is, Firefox, Opera or IE). I've created the JSP file with contentType="application/vnd.ms-excel" But I'm not getting it. Here's my code snippet : <%@page session="true" contentType="application/vnd.ms-excel" pageEncoding="UTF-8"%> <%@page import="org.apache.poi.ss.usermodel.CellStyle"%> <%@page import="java.sql.DriverManager"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql

Apache POI style getting applied to all cells

倖福魔咒の 提交于 2020-01-22 19:55:29
问题 Cell cell = row.createCell(1); cell.setCellValue(rdf.getEffectiveDate()); cell.getCellStyle().setDataFormat(HSSFDataFormat.getBuiltinFormat("d-mmm-yy")); cell = row.createCell(2); cell.setCellValue(rdf.getExpiryDate()); cell.getCellStyle().setDataFormat(HSSFDataFormat.getBuiltinFormat("d-mmm-yy")); row.createCell(3).setCellValue(rdf.getPremium()); row.createCell(4).setCellValue(rdf.getAccountNumber()); row.createCell(5).setCellValue(rdf.getLedgerName()); I wanted to apply Date Format on two