apache-poi

Set Outer Border of Apache POI XWPFTable table?

人盡茶涼 提交于 2020-03-01 04:03:37
问题 I need to set the outer border of a Apache POI XWPFTable table. I know the below command set insade border, but do not find way for setting outer border. table.setInsideHBorder( XWPFBorderType.SINGLE, 4, 0, "FF0000"); Any help? Thanks in advance! 回答1: I find it: CTTblPr tblpro = table.getCTTbl().getTblPr(); CTTblBorders borders = tblpro.addNewTblBorders(); borders.addNewBottom().setVal(STBorder.SINGLE); borders.addNewLeft().setVal(STBorder.SINGLE); borders.addNewRight().setVal(STBorder.SINGLE

How to read data from Excel in JavaFX application?

女生的网名这么多〃 提交于 2020-02-25 10:15:34
问题 I am creating a JavaFX FXMl application with hibernate as ORM in Java. I want to read data from Excel and store it to MySQL using hibernate, but it fails to create Workbook. I have spend hours to read tutorials and other posts whether in SO or other sites, neither accepted answers nor comments helped me. In my Form_Main.fxml file I have a button that calls related method to read data from Excel. I have added following JAR files: * poi-4.1.0 * poi-ooxml-4.1.0 * poi-ooxml-schemas-4.1.0 *

Android Apache POI error when reading Microsoft Word document: org.apache.xmlbeans.SchemaTypeLoaderException Cannot resolve type for handle

核能气质少年 提交于 2020-02-25 02:21:26
问题 I am trying to use Apache POI in my Android application so that I can read Microsoft Word files. I am integrating the POIA library which enables Apache POI usage on Android (https://github.com/SUPERCILEX/poi-android). However, when I run my code and read in a Word file, I receive the following error: Exception: org.apache.xmlbeans.SchemaTypeLoaderException: Cannot resolve type for handle _XY_Q=space|R=space Below is my code (I am receiving error on the first line): var document = XWPFDocument

Read excel columns as string even it contains numeric value without formatting using apache-poi

笑着哭i 提交于 2020-02-20 06:29:08
问题 I need help about an issue that try to reading excel values as it looks. Let me explain with example, In excel my rows with first column (mixed with string values), 10,4 10,2 11.5 //some columns using . notation someString When I try to read values using apache-poi outputs: (it replaces "," with "." not wanted) 10.4 10.2 11.5 someString it should give excatly same output. if it use ".", output should "10.4 if it use "," it should "10,4" Even I format cells the column as text from excel, still

Enable drop down in xls once sheet is protected

放肆的年华 提交于 2020-02-16 07:57:09
问题 I need to enable the drop-down (filters) in a protected XLS sheet. I have written below code and also attached the XLS which gets generated from it. When you open the excel you will see the drop down filters however it will not be enabled for selection. Constraints I have are: I need to keep the protection of the sheet on and I need this feature in XLS format file only (not XLSX). Thanks for your help, Shashank String excelFileName = "C:\\Users\\Admin\\Desktop\\GN_Files\\Test.xls";//name of

Reading a 10 MB file in Apache POI

允我心安 提交于 2020-02-07 06:18:25
问题 The project that I'm working on is trying to read a very large Excel file (a couple hundred columns and around 3000 rows) and recognize patterns in a series of letters. It works just fine on smaller files, but when I try to run it using this file I receive a java.lang.OutOfMemoryError: Java heap space error even when I'm only trying to analyze the first few rows. The error appears to be at Workbook wb = WorkbookFactory.create(new File(filepath)); I've tried a few of the solutions on this

Reading a 10 MB file in Apache POI

醉酒当歌 提交于 2020-02-07 06:15:49
问题 The project that I'm working on is trying to read a very large Excel file (a couple hundred columns and around 3000 rows) and recognize patterns in a series of letters. It works just fine on smaller files, but when I try to run it using this file I receive a java.lang.OutOfMemoryError: Java heap space error even when I'm only trying to analyze the first few rows. The error appears to be at Workbook wb = WorkbookFactory.create(new File(filepath)); I've tried a few of the solutions on this

Reading a 10 MB file in Apache POI

不打扰是莪最后的温柔 提交于 2020-02-07 06:15:49
问题 The project that I'm working on is trying to read a very large Excel file (a couple hundred columns and around 3000 rows) and recognize patterns in a series of letters. It works just fine on smaller files, but when I try to run it using this file I receive a java.lang.OutOfMemoryError: Java heap space error even when I'm only trying to analyze the first few rows. The error appears to be at Workbook wb = WorkbookFactory.create(new File(filepath)); I've tried a few of the solutions on this

How to give poi table margin from left word document

可紊 提交于 2020-02-07 05:17:07
问题 I am creating a word document using POI. I have created a table and a header. I want to give left margin to table so I used this code: CTSectPr getSectPr = doc.getDocument().getBody().getSectPr(); CTPageMar addNewPgMar = getSectPr.addNewPgMar(); addNewPgMar.setLeft(BigInteger.valueOf(200)); addNewPgMar.setRight(BigInteger.valueOf(200)); addNewPgMar.setFooter(BigInteger.valueOf(0)); addNewPgMar.setHeader(BigInteger.valueOf(0)); [![enter image description here][1]][1] But this code also give

How to create a dependent drop down list using [Apache POI]

岁酱吖の 提交于 2020-02-03 15:55:06
问题 Here I am creating one excel template using [Apache POI] in that user can fill data. In that two drop down list are there. Want to create a drop down list that depends on previous cell's drop down. For example: If I select veg category in cell 3, and "rice, curd, milk" items will appear in the dependent drop down list in cell 4. Codes are below. Here collecting data List<InternetItemResponse> internetItems = internetItemService.getAllByHotelId(hotelId); if (CollectionUtils.isNotEmpty