xssf

Apache-POI sets values in Excel, but the formula of another cell is unable to work with the value until I manually press enter in the processing strip

独自空忆成欢 提交于 2019-12-10 11:53:34
问题 I wrote a programm, that writes values into a xlsx-file. At the first glance it seems to work like it should. But in my xlsx-file I've got a Formula in another cell that should works correct if I type in the value manually, but if my programm sets exactly the same value it doesn't work like it should. If I open the file manually after my programm wrote a value and confirm the wrote value by pressing the enter button in the processing strip it works like it should. There are no Exceptions

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);

XSSF (POI) - Adding “formula” column to pivot table

孤街醉人 提交于 2019-12-09 16:50:42
问题 I am using POI 3.12-beta1: <!-- Apache POI (for Excel) --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.12-beta1</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.12-beta1</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>ooxml-schemas</artifactId> <version>1.1</version> </dependency> I am trying to create a calculated pivot table column which is

java.lang.OutOfMemoryError: GC overhead limit exceeded when loading an xlsx file

匆匆过客 提交于 2019-12-08 15:26:35
I understand what the error means, that my program is consuming too much memory and for a long period of the time it is not recovering. My program is just reading 6,2Mb xlsx file when the memory issue occures. When I try to monitor the program, it very quickly reaches 1,2Gb in memory consumption and then it crashes. How can it reach 1,2Gb when reading 6,2Mb file? Is there a way to open the file in chunks? So that it doesn't have to be loaded to the memory? Or any other solution? Exactly this part causes it. But since it is a library, shouldn't it be handled somehow smartly? It is only 200 000

Slow XSSFWorkbook and WorkbookFactory when reading xlsx files

若如初见. 提交于 2019-12-08 07:04:17
问题 I've seen developers have had this problem since a few years ago. I have studied many forums and the official POI documents. Nonetheless I haven't found an answer yet. So the problem is.. I have tried the following two snippets: Workbook wb = WorkbookFactory.create(new File("spreadsheet.xlsx")); and File file = new File("C:\\spreadsheet.xlsx"); OPCPackage opcPackage = OPCPackage.open(file.getAbsolutePath()); XSSFWorkbook workbook = new XSSFWorkbook(opcPackage); and either of the approaches

java POI XSSF FormulaEvaluator

我与影子孤独终老i 提交于 2019-12-08 01:52:54
问题 I am having a problem when i save my new excel file. I want it that when it gets saved the formula calculates itself but at the moment it is just returning a string in the excel file. The formula is correct. I don't know exactly to get the FormulaEvaluator to work. Here is where I enter my formula that returns a string: dataRow1.createCell((short)5).setCellValue("=VLOOKUP(A"+rowCountVlookup+",'C:\\Users\\Admin\\Documents\\JCreator LE\\MyProjects\\WordCount\\classes\\[Pricing.xlsx]Sheet1'!$B$3

Creating cell comments in apache poi (for .xlsx files) with show comments disabled

隐身守侯 提交于 2019-12-07 01:07:29
问题 I am trying to create cells comments using apache poi. I am able to create the comments, but by default they are always displayed in excel. I have to manual right click on the cell and un-tick show comments to make them invisible(now they appear only when I hover on the cell). Is it possible to make cell comments invisible by default(so that they don't appear in the excel until user hover over the cell.) Here is the code I used : Drawing drawing = cell.getSheet().createDrawingPatriarch();

java POI XSSF FormulaEvaluator

给你一囗甜甜゛ 提交于 2019-12-06 10:49:41
I am having a problem when i save my new excel file. I want it that when it gets saved the formula calculates itself but at the moment it is just returning a string in the excel file. The formula is correct. I don't know exactly to get the FormulaEvaluator to work. Here is where I enter my formula that returns a string: dataRow1.createCell((short)5).setCellValue("=VLOOKUP(A"+rowCountVlookup+",'C:\\Users\\Admin\\Documents\\JCreator LE\\MyProjects\\WordCount\\classes\\[Pricing.xlsx]Sheet1'!$B$3:$E$41,4, FALSE)*E"+rowCountVlookup+""); Any help would be much appreciated. I use this code to

POI 读取 Excel 文件(2003版本与2007版本的差异之处)

ε祈祈猫儿з 提交于 2019-12-06 07:57:57
已整理成完整项目,并进行了优化。看参考地址: https://gitee.com/andy_longjie/exceltools 或者 https://github.com/youmulongjie/exceltools 我们在做用POI读物 Excel文件时,往往会忽略了Excel的版本,到底是2003还是2007。于是在读取或写入Excel文件时,用2003版本的Excel和用2007版本的Excel文件,会出现不兼容情况。抛出异常,大概信息如下: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 this data (eg XSSF instead of HSSF); 异常指出我们用了Office2007以上的版本(包含2007),要我们用XSSF来代替HSSF。 于是我们开始替换我们的代码,用XSSF代替HSSF。可是我们却意外的发现poi.jar包中

Jersey @Produces Apache XSSFWorkbook

守給你的承諾、 提交于 2019-12-06 04:18:47
I am trying to produce a XSSFWorkbook using Jersey. I have tried the following headers and nothing seems to work: @Produces("application/xml") @Produces("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") @Produces("application/vnd.openxml" All return the following error: Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class org.apache.poi.xssf.usermodel.XSSFWorkbook, and Java type class org.apache.poi.xssf.usermodel.XSSFWorkbook, and MIME media type application/xml was not found ... 37 more Essentially I have a function which creates the