apache-poi

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

我是研究僧i 提交于 2019-12-04 19:17:29
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-scratchpad-3.8-20120326.dll poi-ooxml-3.8-20120326.jar ikvmc -target:library -resource:poi-3.8-20120326.dll

Apache POI - Invalid part to process data

倖福魔咒の 提交于 2019-12-04 18:54:44
I access an Excel spreadsheet using Java Apache POI ( hssf ). I got the following error : java.lang.RuntimeException: 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) at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:143) at org.testng.internal.Parameters.handleParameters(Parameters.java:426) What am I missing ? To open an xlsx

How to format a column instead of cell in POI hssf

前提是你 提交于 2019-12-04 18:31:46
I'm facing an issue when opening a excel file with hundreds/thousands of rows of data, "Too Many Different Cell Formats" More info about the error http://excelzoom.com/2009/09/the-mystery-of-excels-too-many-different-cell-formats/ So I'm trying to format a column not a cell. The only way I can figure out how to format a column is by formating each individual cell; by implementing the code listed below. I would like to format a column instead of a row. I have hundreds/thousands of rows of data to format. Any suggestions would be very much appreciated. Thanks, HSSFCellStyle cellStyle = wb

How to Highlight a text for a Pargraph in MS word using POI

﹥>﹥吖頭↗ 提交于 2019-12-04 18:16:00
I am developing a compare tool for the word document, whenever there is difference in both the document i need to highlight the substring in the paragraph.When i try to highlight using run, its highlighting whole paragraph instead of the sub string. Can you please guide us, how can i achieve this for a substring. I had the same problem. Here I post a sample method where you highlight a substring contained in a run. private int highlightSubsentence(String sentence, XWPFParagraph p, int i) { //get the current run Style - here I might need to save the current style XWPFRun currentRun = p.getRuns(

Getting null pointer exception in creating cell in Apache POI

五迷三道 提交于 2019-12-04 18:10:54
I am getting a null pointer error everytime I ran my code (below) and it points to the line specified with two asterisk. public void writeSomething(XSSFWorkbook wb){ for (String elem: listOfSheetNames){ if (elem.equals("Sheet2")){ sheet = wb.getSheet(elem); //sheet is of type XSSFSheet XSSFRow row = sheet.getRow(0); **XSSFCell cell = row.getCell(1); if (cell == null){ cell = row.createCell(1); cell.setCellType(Cell.CELL_TYPE_STRING); cell.setCellValue("Apple"); } } } } I am a new to apache poi and am just trying to write data to a blank cell in a 2nd excel sheet (Sheet2). Did I do something

Chinese characters converted to squares when using APACHE POI to convert PPT to Image

限于喜欢 提交于 2019-12-04 17:25:49
I got a problem when I try to use Apache POI project to convert my PPT to Images. My code as follows: FileInputStream is = new FileInputStream("test.ppt"); SlideShow ppt = new SlideShow(is); is.close(); Dimension pgsize = ppt.getPageSize(); Slide[] slide = ppt.getSlides(); for (int i = 0; i < slide.length; i++) { BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); //clear the drawing area graphics.setPaint(Color.white); graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height)); //render slide

Updating Excel sheet values based on a csv sheet with Apache POI

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 15:19:10
I am still new to java. I am having a bit problems with the java syntax. My Program should do the following procedure: 1) It takes a csv file as an input. 2) It takes an excel file as an input. 3) It should iterate over the first columns of the two files where the dates are written. 4) Update the excel file by adding the information from the csv sheet and save its changes. I have a https://onedrive.live.com/?cid=24b4fceb4f4e4098&id=24B4FCEB4F4E4098%213018&authkey=%21AKKzaZsJ5pkd5NE where I have the two input examples and how the result excel sheet should look like. Two Input files: export-csv

Apache POI xlsx read, cell with # value - error unexpected cell type(5)

允我心安 提交于 2019-12-04 14:59:09
Could you hepl me with such issue. I need to read each cell as String value. In this case I am using appache poi lib. and such method for normilizing each cell: String getNormilizedCell(Cell cell){ return new DataFormatter().formatCellValue(cell);} But when In .xlsx file I faced with such value: |#N/A|#N/A|...|...|... I am getting error [Unexpected Cell type (5)] and I don't know how to handle this. In google I can't find necessary information. rgettman The DataFormatter class only handles CELL_TYPE_FORMULA , CELL_TYPE_NUMERIC , CELL_TYPE_STRING , CELL_TYPE_BOOLEAN , and CELL_TYPE_BLANK . It

How to create java poi bar chart combining two bars value like given image?

北城以北 提交于 2019-12-04 14:55:54
I want to create bar chart something like this with java poi , (Has two set of bars),Till now could find only for single type of bars, can anyone help me out with any reference?? Thanks. Axel Richter Not clear from your question what code for creating bar chart using apache poi you have found already. Until now apache poi does only supporting line chart and scatter chart but not bar chart directly. So creating a bar chart is only possible using the underlaying low level objects. For a reference do starting with org.openxmlformats.schemas.drawingml.x2006.chart.CTChart . Example code which

Which is better open source for Excel file parsing in Java?

好久不见. 提交于 2019-12-04 14:51:55
Which is better API for excel parsing in Java Apache POI or JExcel API? In terms of speed, memory utilization and code stability. Personally I would recommend POI over JExcel. The reasons I chose POI over JExcelAPI are: POI supports both old and new MS Excel sheet formats It has a cleaner API (imho) As far as I can see it does not suffer from the irritating Date\Time issues that JexcelApi has ( Date display ). I have had the opportunity to use both. POI, in my opinion, has a really well thought out and easy to use API. The biggest benefit from my perspective is that you can factory off the