apache-poi

Create new or clone XSSFCellStyle from another XSSFCellStyle (POI APACHE)

青春壹個敷衍的年華 提交于 2019-12-10 13:34:14
问题 Requirement I need a new XSSFCellStyle because I have to change some stylings. Situation I only have a XSSFCellStyle - I don't have the XSSFCell it belongs to. Thus I also don't have access to the related XSSFSheet or XSSFWorkbook . What I already tried I don't have the XSSFWorkbook therefore I can't call workbook.createCellStyle() . The XSSFCellStyle constructor needs at least a StylesTable which I also don't have (because I couldn't find a way to get it from the old XSSFCellStyle ). The

Excel read error : Invalid header signature. How to resolve?

最后都变了- 提交于 2019-12-10 13:32:52
问题 I am uploading one excel file from browser. I am using POI jar. But getting error Invalid header signature; read 3255307777713450285, expected -2226271756974174256 below the two jsp files i have used: JSP 1: <form action="Upload.jsp" enctype="MULTIPART/FORM-DATA" method=post > <input type="file" name="filename" /> <input type="submit" value="Upload" /> </form> JSP 2:Upload.jsp try{ InputStream file = request.getInputStream(); POIFSFileSystem myFileSystem = new POIFSFileSystem(file);

Apache POI Width calculations

左心房为你撑大大i 提交于 2019-12-10 13:08:30
问题 I'm having problems getting the exact size I want with my calculations for columnWidth and my calculated row height because I don't understand the documentation. In terms of columnWidth, I am using the line of code sheet.setColumnWidth(int columnIndex, int width); but I don't understand how to properly calculate width. I get that it says: width = Truncate([{Number of Visible Characters} * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256 So I have an exact Excel sheet

Apache-POI sets values in Excel, but the formula of another cell is unable to work with the value until I manually press enter in the processing strip

独自空忆成欢 提交于 2019-12-10 11:53:34
问题 I wrote a programm, that writes values into a xlsx-file. At the first glance it seems to work like it should. But in my xlsx-file I've got a Formula in another cell that should works correct if I type in the value manually, but if my programm sets exactly the same value it doesn't work like it should. If I open the file manually after my programm wrote a value and confirm the wrote value by pressing the enter button in the processing strip it works like it should. There are no Exceptions

Word, PDF document parsing - Hadoop/in-general Java

我的未来我决定 提交于 2019-12-10 11:36:53
问题 My objective is to load MS-Word, PDF etc. documents onto HDFS and extract certain 'content' out of each document and use it further for some analysis. Instead of beginning to fiddle with InputFormat etc., I thought that libraries like Tika can be used and incorporated in MR. The partial content of one of the Word doc. is as follows: 6. Statement of Strategy We have 4 strategic interventions that will deliver a competitive advantage. Innovate upstream and downstream 1. Biopulp. We will execute

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

倖福魔咒の 提交于 2019-12-10 11:28:49
问题 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

apache poi reading date from excel date() function gives wrong date

落爺英雄遲暮 提交于 2019-12-10 11:16:28
问题 Im using an xlsx file that contains a DATE(year, month, day) formula within a cell. This cell is formatted as date, so Excel/OpenOffice shows the proper date. e.g. the cell content is '=DATE(2013;1;1)' which produces : '01.01.2013' So far - so good. When reading this file with the poi library I do: XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/home/detlef/temp/test.xlsx"))); XSSFSheet sheet = workbook.getSheet("Sheet A"); XSSFCell cell = sheet.getRow(0).getCell(0);

Apache POI: Exception while calculating formulae

狂风中的少年 提交于 2019-12-10 11:09:15
问题 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:

Is it possible to convert doc/docx to html using jquery/javascript? [closed]

萝らか妹 提交于 2019-12-10 10:44:39
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I need to convert doc/docx to html. I have files stored in Amazon s3. I need to view & edit it in browser. Right now, I am using Apache POI to convert doc/docx to html. And I am displaying the response on HTML editor(Jquery Plugin). It works but alignment/format changes. Also images not extracted. Any solution

Apache POI - Split Word document (docx) to pages

早过忘川 提交于 2019-12-10 10:43:40
问题 I have been trying to segment a docx document to multiple documents based on a predefined criteria. following is my approach to cut it to paragraphs try { FileInputStream in = new FileInputStream(file); XWPFDocument doc = new XWPFDocument(in); List<XWPFParagraph> paragraphs = doc.getParagraphs(); for (int idx = 0; idx < paragraphs.size(); idx++) { XWPFDocument outputDocument = new XWPFDocument(); createParagraphInAnotherDocument(outputDocument, paragraphs.get(idx).getText()); String fullPath