ASF Bugzilla – Attachment 36907 Details for
Bug 63845
Forumla not evaluated in 4.1.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test case
TestBug63845.java (text/x-java), 1.68 KB, created by
Joern Muehlencord
on 2019-12-01 13:38:33 UTC
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Joern Muehlencord
Created:
2019-12-01 13:38:33 UTC
Size:
1.68 KB
patch
obsolete
>package de.muehlencord.poitests; > >import java.io.File; >import java.io.FileInputStream; >import java.io.FileOutputStream; >import java.io.IOException; >import org.apache.poi.ss.usermodel.Cell; >import org.apache.poi.ss.usermodel.CellType; >import org.apache.poi.ss.usermodel.Row; >import org.apache.poi.ss.usermodel.Sheet; >import org.apache.poi.ss.usermodel.Workbook; >import org.apache.poi.xssf.usermodel.XSSFWorkbook; >import org.slf4j.Logger; >import org.slf4j.LoggerFactory; > >/** > * > * @author Joern Muehlencord (joern@muehlencord.de) > */ >public class TestBug63845 { > > private static final Logger LOGGER = LoggerFactory.getLogger(TestBug63845.class); > > public static void main(String[] args) { > try { > TestBug63845 app = new TestBug63845(); > app.run(); > } catch (IOException ex) { > LOGGER.error(ex.getMessage()); > if (LOGGER.isDebugEnabled()) { > LOGGER.debug("Detailed stacktrace", new Object[]{ex}); > } > } > } > > public void run() throws IOException { > LOGGER.info("Test bug 63845"); > > File file = new File(getClass().getClassLoader().getResource("poitest.xlsx").getFile()); > FileInputStream fis = new FileInputStream(file); > Workbook wb = new XSSFWorkbook(fis); > LOGGER.info("Workbook opened"); > > Sheet sheet = wb.getSheetAt(0); > Row row = sheet.createRow(10); > Cell cell = row.createCell (0, CellType.FORMULA); > cell.setCellFormula("SUM(A3:A5)"); > LOGGER.info("Forula added"); > > // FileOutputStream fos = new FileOutputStream(new File("/tmp/poitest_output_410.xlsx")); > FileOutputStream fos = new FileOutputStream(new File("/tmp/poitest_output_401.xlsx")); > wb.write(fos); > LOGGER.info("Workbook stored"); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 63845
:
36826
|
36827
|
36828
| 36907