apache-poi

Is there any code to read MS Office PPT on Android?

守給你的承諾、 提交于 2019-12-07 09:26:31
问题 I'm looking for code to read MS Office PPT on Android, is there anyone interested in sharing the code? 回答1: You might want to take a look at Apache POI - the Java API for Microsoft Documents The Apache POI Project's mission is to create and maintain Java APIs for manipulating various file formats based upon the Office Open XML standards (OOXML) and Microsoft's OLE 2 Compound Document format (OLE2). In short, you can read and write MS Excel files using Java. In addition, you can read and write

Writing to a particular cell location using Apache POI Excel

会有一股神秘感。 提交于 2019-12-07 09:21:29
问题 If I've got an list of parameters 'x,y,z' that aren't sorted, is there a straightforward way to write them to particular cells in an excel document created with POI, as though the first two parameters are X and Y coordinates? For example, I have rows like: 10,4,100 Is it possible to write the value '100' in the cell at the 10th row, 4th column? Looking at the documentation, it looks straightforward to iterate values into the next row, but I can't see any way of creating a fixed number of rows

How to create cell with multiple styles in excel using HSSFSheet Apache POI?

拜拜、爱过 提交于 2019-12-07 08:48:59
问题 I am creating a script for export document as excel. How to have cell value like " Name: Mark DOB: 11-11-2014" by merging few cells? 回答1: What you need to do is create a RichTextString for your cell. That's the way of applying different formatting / styles to different parts of the same cell for display in Excel You'll want to review the POI "Working With Rich Text" example for more on how to use it, but broadly it'll be something like Cell cell = row.createCell(1); RichTextString rt = new

How to get the line number, page number of a particular word in a doc,docx file using apache poi?

≡放荡痞女 提交于 2019-12-07 08:20:36
问题 I am trying to create a java application which would search for particular word in the selected doc, docx file and generates a report on it. That report will contain the page number and the line number of the searched word. Now that what I have achieved is I am able to read the doc and docx file by paragraph. But I didn't find any way to search for a particular word and to get the line & page number where that word is present. I searched a lot but no luck till now. Hope someone knows the way

Creating a new cell, copies previous cell's style in Apache POI..?

天涯浪子 提交于 2019-12-07 07:57:18
问题 In my java class I am declaring cell like: HSSFCell cell = null; And I am using this cell in many places to create a cell and set values, styles. Like: cell = row.createCell(1); cell.setCellValue("1234.00"); setCellStyle(currency, cell, workbook); cell = row.createCell(2); setCellValue("2445.00"); Now, surprisingly, the first cell's data format is being applied to 2nd cell. Anyone has any idea? I expect the 2nd cell's style to be none. And the 1st cell's style should be with the data format

How to create new rows in apache poi 3.6?

老子叫甜甜 提交于 2019-12-07 07:35:30
I am using Apache POI 3.6 and java in our application. I have data in row numbers 9 to 30. Now, I want to include new rows after the row number 25. After doing like this, the old data in 26 to 30 was destroyed.... I want to add that new rows without destroy the old row's data... We can manually, create new rows by just right click the mouse on the row Header like row number 25 and select insert then it will include the 26 row without deleting anything about the old values. How I do it programatically using apache poi and java? First you need to do move down all the rows from 25 onwards by

apache POI - get size of generated excel file

老子叫甜甜 提交于 2019-12-07 06:47:34
问题 I'm using Apache POI for generating excel file in my spring mvc application. here is my spring action: @RequestMapping(value = "/excel", method = RequestMethod.POST) public void companyExcelExport(@RequestParam String filter, @RequestParam String colNames, HttpServletResponse response) throws IOException{ XSSFWorkbook workbook = new XSSFWorkbook(); //code for generate excel file //.... response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response

Your InputStream was neither an OLE2 stream, nor an OOXML stream

微笑、不失礼 提交于 2019-12-07 06:10:41
问题 I am using Apache Commons to upload a .docx file in google app engine as explained in this link File upload servlet. While uploading, I also want to extract text by using Apache POI libraries. If I pass this to the POI API: InputStream stream = item.openStream(); I get the below exception: java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream public static String docx2text(InputStream is) throws Exception { return ExtractorFactory.createExtractor

Parsing Excel file without Apache POI

六月ゝ 毕业季﹏ 提交于 2019-12-07 05:38:42
问题 I know that we can use Apache POI to parse an Excel file and get data. But I heard of a strange thing that excel file can be passed in a similar way we parse CSV (Like just read the file from file Stream and separate each column value with a "comma" separator). When we parse Excel we have to use tab as a delimiter. Is it possible? If yes then why Apache has come up with such a complicated framework. I am puzzled. Can someone help me? 回答1: CSV is a text format, so it can be parsed using the

Apache POI, calling autosize after auto filter

大兔子大兔子 提交于 2019-12-07 05:35:43
问题 I have been searching for a while, and haven't been able to find a solution as yet. This question has been asked before on here but the OP didn't get a response and I didn't want to resurrect an old thread so decided on asking a new question. The OP thread is here. The problem I'm having is that I've got a spreadsheet which is created with data obtained from a database, however sometimes the data within cells can be quite lengthy, so wanted POI to autosize to save the user having to do it,