How-to-Use Formula Inquiries
** It is necessary to guide how to use the formula in general, whether the method is different depending on the type of formula and how to use it for normal output.
Example 1. Conversion using formula. Request to check the part where an error occurs when a field is applied in the place of the expression successful expression
- The part marked in red in the formula (conversion failure) is an expression in which only data is substituted as a field in the actual successful expression
Example 2. Request guidance on how to use the IF formula because it is normally output when only the IF formula is used differently from other formulas
- The method of use differs when comparing IF-Method 1 and IF-Method 2 in the formula (conversion success)
What you have seen in the conversion of formulas to date
1) Currently, only IF, SUM, PRODUCT, and INT are mentioned as examples, but before checking whether errors in other functions occur
2) In the docx file, for example, INT, the data conversion was confirmed to be successful, but the SUM, PRODUCT function could not be calculated and only numbers were listed
3) When converting to a pdf file, it is confirmed that an error appears when a field is included in the formula
The code for use is as follows
- Code: Select all
InputStream is = new ByteArrayInputStream(listStream.get(0).toByteArray());
Document doc = new Document();
doc.insertTextFromStream(is, FileFormat.Docx);
doc.setKeepSameFormat(true);
for(int i = 1 ; i < listStream.size() ; i ++) {
is = new ByteArrayInputStream(listStream.get(i).toByteArray());
doc.insertTextFromStream(is, FileFormat.Docx);
doc.getLastSection().setBreakCode(SectionBreakType.New_Page);
}
doc.getLastSection().setBreakCode(SectionBreakType.New_Page);
doc.isUpdateFields(true);
if(ExtensionType.DOCX.equals(type)) {
doc.saveToFile(filePath+type.getCode(), FileFormat.Docx); //docx 파일 저장
}else {
ToPdfParameterList ppl = new ToPdfParameterList();
ppl.isEmbeddedAllFonts(true);
doc.saveToFile(filePath+type.getCode(), ppl);
}