Skip to content
Advertisement

Tag: apache-poi

SUM(ABOVE) functionality in apache poi or docx4j

I am trying to implement =SUM(ABOVE) function in docx which is used to sum all elements above to tht column. I was able to implement this with apache poi using : This is ok when someone opens the document and it calculates it. But if I need to convert the document without opening it to pdf then this function doesnt

Why am I getting IllegalArgumentException while using copyRowFrom(…) in XSSFRow?

I’m trying to use copyRowFrom(…); to copy the first row of a spreadsheet to the first row of a new XSSFSheet but something is not working right. You can find the XSSFRow class and the method here: https://github.com/apache/poi/blob/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java#L581 I’m getting IllegalArgumentException(“amountToMove must not be zero”) from FormulaShifter.java: https://github.com/apache/poi/blob/trunk/src/java/org/apache/poi/ss/formula/FormulaShifter.java#L80 It seems that the problem is at line 623 of XSSFRow where

Docx to Pdf Converter in java

The below code is not working with Apache poi 3.16. Can someone provide with the correct solution, in my project there are some dependency for using only Exception: Answer The main problem with this is that those PdfOptions and PdfConverter are not part of the apache poi project. They are developed by opensagres and first versions were badly named org.apache.poi.xwpf.converter.pdf.PdfOptions

Apache POI java.lang.NoSuchMethodError

My code is below: And the error code I get is: The dependencies for Apache that I have added to my netbeans library are: And from here I pretty much have no idea what to do. Can anyone tell me if my code is wrong or what other dependencies I need? Answer Ok, so as rgettman explained, I had to

Replace text templates inside .docx (Apache POI, Docx4j or other)

I want to do replacements in MS Word (.docx) document using regular expression (java RegEx): I tried to get text templates (like %SOME_TEXT%) use Apache POI – XWPF and replace text, but replacement is not guaranteed, because POI separates runs => I get something like this(System.out.println(run.getText(0))): code example: I have found many similar questions (like this “Replacing a text in

Advertisement