jexcelapi

How to Edit/Modify an existing Excel file in Java with Jexcel API

别说谁变了你拦得住时间么 提交于 2019-12-10 12:18:33
问题 I want to edit an existing Excel file with Java, to add some more data to an existing template excel file. So i used Jexcel for this purpose. As suggested everywhere, I tried the following, Workbook existingWorkbook = Workbook.getWorkbook(new File("H://"+file_name)); WritableWorkbook copy = Workbook.createWorkbook(new File("H://"+file_name+"_temp1.xls")); But it shows an exception in the second line. jxl.common.AssertionFailed at jxl.common.Assert.verify(Assert.java:37) at jxl.read.biff

Making new colors in JExcelApi

谁都会走 提交于 2019-12-10 02:56:30
问题 I'm using JExcelApi for generating XLS files. From jxl.format.Colour, I see how to get any of the colors in the "standard Excel colour palette", but not how to create a new color (say, given its RGB). But in Excel itself, I can pick any color at all. Am I just missing it? Is there a way in JExcelApi to select an arbitrary color? I'm using a simple find-the-closest-standard-color method right now, which is OK but not great. 回答1: Excel versions before 2007 have a standard palette, and given

Which library should I use to write an XLS from Linux / Python?

不问归期 提交于 2019-12-09 06:05:46
问题 I'd love a good native Python library to write XLS, but it doesn't seem to exist. Happily, Jython does. So I'm trying to decide between jexcelapi and Apache HSSF: http://www.andykhan.com/jexcelapi/tutorial.html#writing http://poi.apache.org/hssf/quick-guide.html (I can't use COM automation because I'm not on Windows, and even if I was, I couldn't afford Office licenses.) My initial thoughts are that POI/HSSF is very thorough, but also very Java-- everything seems a bit harder than it needs to

Reading multiple excel sheet

此生再无相见时 提交于 2019-12-08 09:07:15
问题 I am trying to read the sheets of a spread sheet uisng a foor loop. I wanted to know is this the right way of reading especially the use of Sheet Propety [highlighted in the code] : Cell[][] newcell=new Cell[200][200]; int newsheet = workbook1.getNumberOfSheets(); for (int q=1;q < newsheet;q++) { for(int p=0;p < sheet(q).getColumns();p++) { for(int p1=0;p1<sheet(q).getRows();p1++) /*^^^^^^^^^*/ { newcell[p][p1] = sheet(q).getCell(p, p1); /*^^^^^^^^^*/ if(newcell[p][p1].equals(saved[j])) {

Password protected xls/xlsx file in java

為{幸葍}努か 提交于 2019-12-08 02:52:03
问题 I have created password protected zip file which has xls file with the help of this http://java.sys-con.com/node/1258827. My question is ,Is there any java api which will create password protected xls file instead of zip file. I want to directly apply password on xls file.Encryption/Decryption is the option but want to prompt when when double clicked on file. edit: I got this HSSFSheet.protectSheet("xyz"); but it only makes sheet read only. Even I have tried this hssfworkbook

How to insert a table in ms excel using apache java poi

江枫思渺然 提交于 2019-12-07 20:38:45
问题 I am trying to insert a table in Excel using Java Apache Poi. But when I am opening the xlsx file it is throwing the following error and I could not solve it: Removed Part: /xl/tables/table1.xml part with XML error. (Table) Load error. Line 2 repaired records: table from /xl/tables/table1.xml part (table) My code is the following: import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache

Is there any Java library which supports both Microsoft office and Open Office?

心已入冬 提交于 2019-12-07 17:03:42
问题 As Apache POI supports Microsoft office and JExcelApi supports Open Office, is there any Java library which supports both Microsoft office and Open Office? Note: In the pom.xml file we are using either POI and JExcel utilities in order to fetch/read data from the Excel sheet in Microsoft office and Open Office respectively. So my question: Is there any library which supports both? 回答1: Aspose covers all of Microsofts formats, but it is not free and not open source. Regarding open source Java

How to insert a table in ms excel using apache java poi

六眼飞鱼酱① 提交于 2019-12-06 09:07:52
I am trying to insert a table in Excel using Java Apache Poi. But when I am opening the xlsx file it is throwing the following error and I could not solve it: Removed Part: /xl/tables/table1.xml part with XML error. (Table) Load error. Line 2 repaired records: table from /xl/tables/table1.xml part (table) My code is the following: import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFTable; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org

Password protected xls/xlsx file in java

僤鯓⒐⒋嵵緔 提交于 2019-12-06 07:18:08
I have created password protected zip file which has xls file with the help of this http://java.sys-con.com/node/1258827 . My question is ,Is there any java api which will create password protected xls file instead of zip file. I want to directly apply password on xls file.Encryption/Decryption is the option but want to prompt when when double clicked on file. edit: I got this HSSFSheet.protectSheet("xyz"); but it only makes sheet read only. Even I have tried this hssfworkbook.writeProtectWorkbook("abc", "abc"); but its not prompting for password. Edit1:There is the method in org.apache.poi

Is there any Java library which supports both Microsoft office and Open Office?

拟墨画扇 提交于 2019-12-06 03:13:33
As Apache POI supports Microsoft office and JExcelApi supports Open Office, is there any Java library which supports both Microsoft office and Open Office? Note: In the pom.xml file we are using either POI and JExcel utilities in order to fetch/read data from the Excel sheet in Microsoft office and Open Office respectively. So my question: Is there any library which supports both? Aspose covers all of Microsofts formats, but it is not free and not open source. Regarding open source Java API, you can find a review on each available java library here, http://www.esupu.com/open-source-office