apache-poi

How to copy a row from existing excel sheet to a new excel sheet using Apache POI?

半腔热情 提交于 2019-12-06 14:02:44
I want to compare two excel sheets and find if any row differs, if it does I want to copy that single row which differs from that excel to a new row in a new excel. Below is a code snippet I took from the net and tried but the problem if I copy the 10th row of the existing excel(for example) to the first row of new excel, 1st row is properly copied in new excel but all the remaining rows from first excel are also copied to the new one. I think the problem is with the way I write to new excel [workbook.write(out)] Please help!! Thanks in advance!! public class RowCopy { public static void main

Convert Apache POI .jar to .dll using IKVM.Net

我们两清 提交于 2019-12-06 13:55:23
问题 I'm trying to convert Apache poi .jar to .dll . I used the script below to convert. However I'm getting lot of warnings and error Invalid option -resource:poi-3.8-20120326.dll after that. Here's the script i used. ikvmc -target:library poi-ooxml-schemas-3.8-20120326.jar ikvmc -target:library poi-3.8-20120326.jar ikvmc -target:library -resource:poi-3.8-20120326.dll poi-scratchpad-3.8-20120326.jar ikvmc -target:library -resource:poi-3.8-20120326.dll poi-ooxml-schemas-3.8-20120326.dll poi

How to Un-Hide a hidden row in Excel using Apache Poi in Java?

北城以北 提交于 2019-12-06 12:28:29
I have: import org.apache.poi.ss.usermodel.Row; if ((currentRow = sheet.getRow(currentDataRow)) == null) { currentRow = sheet.createRow(currentDataRow); // Creates a new row. } // How to un-hide currentRow ? currentRow is hidden, so to un-hide this row using this currentRow object? Please help.. !! Looks like it's getRowStyle().setHidden() : currentRow.getRowStyle().setHidden(false); More info on getRowStyle . I had poi-3.7 and these methods didn't show up either. Downloaded the latest one poi-3.8-beta4 and row.setRowStye() and row.getRowStye() are present Row.getRowStyle() : Returns the whole

Apache POI: Exception while calculating formulae

佐手、 提交于 2019-12-06 11:49:08
I have gone through many questions posted here and referred POI documentation too, but i am not able to resolve this issue. Issue: When trying to re-calculate the formula i am getting an exception. Formula: =CONCATENATE("#DFLT=",COUNTIF(C5:C390,"=DEFAULTERS"),"; #NP=",COUNTIF(C5:C390,"=NOT PAID"),"; #PCsh=",COUNTIF(C5:C390,"=Paid Cash"),"; #PChk=",COUNTIF(C5:C390,"=Paid Cheque"),"; #PNeft=",COUNTIF(C5:C390,"=Paid Neft")) Exception: 10-22 17:13:15.177: E/AndroidRuntime(26300): FATAL EXCEPTION: main 10-22 17:13:15.177: E/AndroidRuntime(26300): java.lang.IllegalArgumentException: Unexpected eval

Apache POI usage with Apache Felix

谁都会走 提交于 2019-12-06 11:35:45
I'm trying to import Apache POI to Atlassian Jira Plugin for reading excel files. At the beginning, I started with adding just <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> </dependency> poi.version is 3.14 then when I started the plugin it gave Unresolved constraint

Apache POI & colors

落花浮王杯 提交于 2019-12-06 11:31:23
问题 I've some problems with Apache POI, some help would be nice!! I would like to remove the colors in a subpart of an Excel sheet. To do so, the first thing I tried is to render the cells I want to clean (let say the one of the first row only) and to set their color to white: cell.getCellStyle().setFillForegroundColor(IndexedColors.WHITE.index); But if i do that, the color of some cells that are not rendered (let say the one of the second row) are also changed to white cells. It's strange,

POI for XPages - save Word document as attachment in rich text field

China☆狼群 提交于 2019-12-06 11:22:13
I'm using the OpenNTF POI 4 XPages plugin. This works very well for generating Word Documents. Now, after generating the Word document, I would like to create a new response document and store the word document as an attachment in a rich text field in this response document. Here is my code (in the poi postGenerationProcess property of the POI 4 XPages widget): var doc:NotesDocument = currentDocument.getDocument(); var rdoc:NotesDocument = database.createDocument(); rdoc.appendItemValue("Form", "frmRespTempl"); rdoc.appendItemValue("Subject", "Embedded Word Document"); var rtitem

How to open .xlsx files with POI SS?

做~自己de王妃 提交于 2019-12-06 10:50:28
I am trying to open .xlsx files with POI SS with this code (taken from http://poi.apache.org/spreadsheet/quick-guide.html#ReadWriteWorkbook ): InputStream inp = new FileInputStream("workbook.xls"); //InputStream inp = new FileInputStream("workbook.xlsx"); Workbook wb = WorkbookFactory.create(inp); Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(2); Cell cell = row.getCell(3); if (cell == null) cell = row.createCell(3); cell.setCellType(Cell.CELL_TYPE_STRING); cell.setCellValue("a test"); // Write the output to a file FileOutputStream fileOut = new FileOutputStream("workbook.xls"); wb

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

How to read empty cell in excel file using poi and how to add this empty cell to array list?

醉酒当歌 提交于 2019-12-06 10:38:55
问题 public void readExcel(String fileName) try { FileInputStream myInput = new FileInputStream(fileName); POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput); HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem); HSSFSheet mySheet = myWorkBook.getSheetAt(0); Iterator rowIter = mySheet.rowIterator(); while(rowIter.hasNext()) { HSSFRow myRow = (HSSFRow) rowIter.next(); Iterator cellIter = myRow.cellIterator(); ArrayList cellStoreVector=new ArrayList(); String header_name = null; while