apache-poi

Force full calculation of entire workbook in Coldfusion / Apache POI

守給你的承諾、 提交于 2019-12-10 10:27:51
问题 Given a workbook with cross-sheet formulas generated by Coldfusion 9 via Apache POI . I want to programmatically force an entire workbook to do a "full calculation with dependency tree rebuild" before saving the workbook to disk. So that when my end-users open the spreadsheet, they do not have to press Ctrl - Alt - Shift - F9 . How do I accomplish this in coldfusion ? References: http://adobe.ly/HbLBZo http://poi.apache.org/spreadsheet/eval.html http://bit.ly/HJJA3Q 回答1: Unfortunately there

Java Web Start causing slow execution

旧街凉风 提交于 2019-12-10 10:23:11
问题 I have an application that I'm deploying with Java Web Start. When I was doing unit testing, I noticed a slight problem: whenever my application is run with Java Web Start, a particular operation takes a long time to execute. When run locally, however, it is quite fast. The particular operation I'm talking about is reading in a large (5k row) Excel file to parse it. This is the line of code: Workbook wb = WorkbookFactory.create(new FileInputStream(new File(inputFile.getText()))); To figure

Adding shapes to Powerpoint slide using XSLF (Apache POI Project)

你说的曾经没有我的故事 提交于 2019-12-10 09:48:55
问题 The apache POI project explains how to read a shape from a powerpoint slide http://poi.apache.org/slideshow/xslf-cookbook.html#GetShapes However, I can't find any doc on how to add a shape to a powerpoint slide using this part of the library. If I use an old powerpoint format (ppt as opposed to pptx), I can just use the hslf part of the libaray and do: SlideShow ppt = new SlideShow(); //add first slide Slide s1 = ppt.createSlide(); // create shapes./ java.awt.geom.GeneralPath path = new java

Excel file created with apache poi (Java) can't be opened on Windows

允我心安 提交于 2019-12-10 09:28:46
问题 In my system, I have a class that creates an excel with some data. Basically I read all String values from a variable ArrayList> and write them in excel cells. public void writeData(Data data, int sheetNumber) throws EncryptedDocumentException, InvalidFormatException, IOException { org.apache.poi.ss.usermodel.Workbook workbook; try { workbook = WorkbookFactory.create(new File(path)); } catch (FileNotFoundException e) { workbook = new HSSFWorkbook(); } org.apache.poi.ss.usermodel.Sheet sheet;

How to create sheet with right-to-left alignment using Apache POI XSSF

∥☆過路亽.° 提交于 2019-12-10 09:05:33
问题 I'm trying to create a sheet in the Excel file using Apache POI. Since it's Excel 2007, I'm using XSSF and I'm looking a for way to make a sheet right-to-left aligned. In HSSF there is a method org.apache.poi.hssf.usermodel.HSSFSheet.setRightToLeft(boolean) , but I cannot find it in org.apache.poi.xssf.usermodel.XSSFSheet . I'm using Apache POI 3.7 回答1: The workaround: XSSFSheet sheet = workbook.createSheet(); sheet.getCTWorksheet().getSheetViews().getSheetViewArray(0).setRightToLeft(true);

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFWorkbook.createDataFormat()Lorg/apache/poi/hssf/usermodel/HSSFDataFormat;

蹲街弑〆低调 提交于 2019-12-10 04:54:27
问题 I have some troubles to export my report as XLS . The export as PDF works well. So I tried to update to the latest JasperReports and Apache POI version: JasperReports: 5.5.0 POI: 3.7 iText: 2.1.7 But I receive always following exception: java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFWorkbook.createDataFormat()Lorg/apache/poi/hssf/usermodel/HSSFDataFormat; net.sf.jasperreports.engine.export.JRXlsExporter.openWorkbook(JRXlsExporter.java:284) net.sf.jasperreports.engine.export

Apache POI rows number

送分小仙女□ 提交于 2019-12-10 03:44:03
问题 I am using Apache POI java and want to get the total number of rows which are not empty. I successfully processed a whole row with all its columns. Now I am assuming that I get an excel sheet with multiple rows and not a single row...so how to go about that? I was thinking of getting total number of rows (int n) and then loop until i<=n but not sure. Suggestions are most welcome :) Note: Apache POI version is 3.8. I am not dealing with Xlsx format...only xls. Yes I tried this code but got 20

Apache POI much quicker using HSSF than XSSF - what next?

感情迁移 提交于 2019-12-10 02:22:35
问题 I've been having some issues with parsing .xlsx files with Apache POI - I am getting java.lang.OutOfMemoryError: Java heap space in my deployed app. I'm only processing files under 5MB and around 70,000 rows so my suspicion from reading number other questions is that something is amiss. As suggested in this comment I decided to run SSPerformanceTest.java with the suggested variables so see if there is anything wrong with my code or setup. The results show a significant difference between HSSF

Remove all borders on a specific excel worksheet using Apache POI

旧时模样 提交于 2019-12-10 02:17:27
问题 I am using Apache POI to generate an Excel file. I need to delete all of the borders in my worksheet. How can I accomplish this using Apache PIO 3.11 and Microsoft Excel 2007? Here is the code I have so far: package models; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; import java.io.FileOutputStream; import java.util.List; public class Excel { public static void writeDocument() { Workbook workbook =

apache poi cellIterator skips blank cells but not in first row

隐身守侯 提交于 2019-12-10 02:14:09
问题 I am creating a java program to read an excel sheet and create a comma separated file. When I run my sample excel file, with blank columns, The first row works perfectly, but the rest of the rows skip the blank cells. I have read about the code changes required to insert blank cells into the rows, but my question is why does the first row work ???? public ArrayList OpenAndReadExcel(){ FileInputStream file = null; HSSFWorkbook workBook = null; ArrayList <String> rows = new ArrayList(); //open