apache-poi

How To Set Excel Default Row Height in Apache POI

陌路散爱 提交于 2020-08-19 11:40:46
问题 I'm using Apache POI 3.7 with Spring MVC 3.1. How to set excel default row height in apache POI? I've tried sheet.setDefaultRowHeight((short) 100) and sheet.setDefaultRowHeightInPoints(100) but that doesn't work. Any suggestion for this problem? Thank you. 回答1: I use row.setHeightInPoints((2 * sheet.getDefaultRowHeightInPoints())); to set it (for example) to 2 characters high. 回答2: Create a style with the desired height and apply it to the cells you want to appear that way. Documentation can

How To Set Excel Default Row Height in Apache POI

ぃ、小莉子 提交于 2020-08-19 11:38:59
问题 I'm using Apache POI 3.7 with Spring MVC 3.1. How to set excel default row height in apache POI? I've tried sheet.setDefaultRowHeight((short) 100) and sheet.setDefaultRowHeightInPoints(100) but that doesn't work. Any suggestion for this problem? Thank you. 回答1: I use row.setHeightInPoints((2 * sheet.getDefaultRowHeightInPoints())); to set it (for example) to 2 characters high. 回答2: Create a style with the desired height and apply it to the cells you want to appear that way. Documentation can

Using Apache POI HSSFListener how to identify date type

我的梦境 提交于 2020-08-10 19:54:48
问题 Due to millions of records to handle, I have to handle SAX parsing using the technique given here. http://poi.apache.org/spreadsheet/how-to.html#event_api. However Date type is convered to Number. How to distinguish between Date and Number when using HSSFListener? 回答1: The Excel file formats store all dates as numbers with special formatting rules. It's not that HSSF is converting it, you're getting exactly what Excel stores in the file! If you want good examples of HSSF Event processing for

Required maven dependencies for Apache POI to work

二次信任 提交于 2020-08-02 05:41:47
问题 I want to use Apache POI library to parse excel files (old versions and newer versions of excel). So I was wondering what jars do i need to include from the Apache POI because in following link: http://mvnrepository.com/artifact/org.apache.poi I found lots of jars to be included, do I need to include them all? If so, what is the latest stable version to be included, and does it work with Microsoft's Office 2010? 回答1: No, you don't have to include all of POI 's dependencies. Maven's transitive

Required maven dependencies for Apache POI to work

﹥>﹥吖頭↗ 提交于 2020-08-02 05:41:26
问题 I want to use Apache POI library to parse excel files (old versions and newer versions of excel). So I was wondering what jars do i need to include from the Apache POI because in following link: http://mvnrepository.com/artifact/org.apache.poi I found lots of jars to be included, do I need to include them all? If so, what is the latest stable version to be included, and does it work with Microsoft's Office 2010? 回答1: No, you don't have to include all of POI 's dependencies. Maven's transitive

How to Edit existing large excel file with SXSSF Streaming api

主宰稳场 提交于 2020-07-23 07:38:10
问题 I have a large .xlsx excel sheet with 400,000 rows. I want to read and write in this existing workbook. When i tried to read it in java with Apache poi, with following code: FileInputStream fileInputStream = new FileInputStream(new File(excelPath)); Workbook wb = new XSSFWorkbook(fileInputStream); Second line of this code takes RAM upto 5gb. Apache POI has given a SXSSF Streaming API to handle large Excel file. http://poi.apache.org/components/spreadsheet/how-to.html#sxssf Now, when I

How to Edit existing large excel file with SXSSF Streaming api

丶灬走出姿态 提交于 2020-07-23 07:37:25
问题 I have a large .xlsx excel sheet with 400,000 rows. I want to read and write in this existing workbook. When i tried to read it in java with Apache poi, with following code: FileInputStream fileInputStream = new FileInputStream(new File(excelPath)); Workbook wb = new XSSFWorkbook(fileInputStream); Second line of this code takes RAM upto 5gb. Apache POI has given a SXSSF Streaming API to handle large Excel file. http://poi.apache.org/components/spreadsheet/how-to.html#sxssf Now, when I

How to Edit existing large excel file with SXSSF Streaming api

让人想犯罪 __ 提交于 2020-07-23 07:36:19
问题 I have a large .xlsx excel sheet with 400,000 rows. I want to read and write in this existing workbook. When i tried to read it in java with Apache poi, with following code: FileInputStream fileInputStream = new FileInputStream(new File(excelPath)); Workbook wb = new XSSFWorkbook(fileInputStream); Second line of this code takes RAM upto 5gb. Apache POI has given a SXSSF Streaming API to handle large Excel file. http://poi.apache.org/components/spreadsheet/how-to.html#sxssf Now, when I

How to Edit existing large excel file with SXSSF Streaming api

 ̄綄美尐妖づ 提交于 2020-07-23 07:36:11
问题 I have a large .xlsx excel sheet with 400,000 rows. I want to read and write in this existing workbook. When i tried to read it in java with Apache poi, with following code: FileInputStream fileInputStream = new FileInputStream(new File(excelPath)); Workbook wb = new XSSFWorkbook(fileInputStream); Second line of this code takes RAM upto 5gb. Apache POI has given a SXSSF Streaming API to handle large Excel file. http://poi.apache.org/components/spreadsheet/how-to.html#sxssf Now, when I

Apache POI - convert word to pdf

不打扰是莪最后的温柔 提交于 2020-07-22 22:11:03
问题 I am trying to convert XWPFDocument to PDF but getting an error. I am using - https://mvnrepository.com/artifact/fr.opensagres.xdocreport/fr.opensagres.poi.xwpf.converter.pdf/2.0.1. <!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport /fr.opensagres.poi.xwpf.converter.pdf --> <dependency> <groupId>fr.opensagres.xdocreport</groupId> <artifactId>fr.opensagres.poi.xwpf.converter.pdf</artifactId> <version>2.0.1</version> </dependency> Code: FileInputStream fis = new FileInputStream("1