apache-poi

Renaming headers of XSSFTable with Apache Poi leads to corrupt XLSX-file

怎甘沉沦 提交于 2021-02-09 18:00:57
问题 I am trying to rename headers of an existing xlsx-file. The idea is to have an excel-file to export data from XML to excel and reimport the XML once some user has made adjustments. At the moment we have created a "template" xlsx-sheet with Excel which already contains a sortable table (XSSFTable in poi) and a mapping to a XSD-source. Then we import it via POI, map XML data into it and save it. To adjust the sheet to the users we want to translate the headers/column-names of this existing

How to store time spent or total duration in Java?

▼魔方 西西 提交于 2021-02-08 16:43:44
问题 I am automating a excel report using the POI API for Java. I will have few reports in my disposal which I read using POI, process them, and create a new excel report. One of columns from an excel file has total time spent, that is, it could in following format, 46:23:12 - this reads as 46 hours, 23 minutes and 12 seconds . I understand how to read date and time values and I usually store them in java.util.Date . The problem here is this is a time duration, the hours spent could be more than

How to store time spent or total duration in Java?

柔情痞子 提交于 2021-02-08 16:43:21
问题 I am automating a excel report using the POI API for Java. I will have few reports in my disposal which I read using POI, process them, and create a new excel report. One of columns from an excel file has total time spent, that is, it could in following format, 46:23:12 - this reads as 46 hours, 23 minutes and 12 seconds . I understand how to read date and time values and I usually store them in java.util.Date . The problem here is this is a time duration, the hours spent could be more than

How to store time spent or total duration in Java?

馋奶兔 提交于 2021-02-08 16:42:56
问题 I am automating a excel report using the POI API for Java. I will have few reports in my disposal which I read using POI, process them, and create a new excel report. One of columns from an excel file has total time spent, that is, it could in following format, 46:23:12 - this reads as 46 hours, 23 minutes and 12 seconds . I understand how to read date and time values and I usually store them in java.util.Date . The problem here is this is a time duration, the hours spent could be more than

How to store time spent or total duration in Java?

大城市里の小女人 提交于 2021-02-08 16:42:35
问题 I am automating a excel report using the POI API for Java. I will have few reports in my disposal which I read using POI, process them, and create a new excel report. One of columns from an excel file has total time spent, that is, it could in following format, 46:23:12 - this reads as 46 hours, 23 minutes and 12 seconds . I understand how to read date and time values and I usually store them in java.util.Date . The problem here is this is a time duration, the hours spent could be more than

How to read doc and docx file in java with POI api

拈花ヽ惹草 提交于 2021-02-08 13:12:40
问题 I am trying to read doc and docx files. here is the code: static String distination="E:\\ static String docFileName="Requirements.docx"; public static void main(String[] args) throws FileNotFoundException, IOException { // TODO code application logic here ReadFile rf= new ReadFile(); rf.ReadFileParagraph(distination+docFileName); } public void ReadFileParagraph(String path) throws FileNotFoundException, IOException { FileInputStream fis; File file = new File(path); fis=new FileInputStream

What to use instead of deprecated CellRangeAddress.valueOf in ApachePOI

浪子不回头ぞ 提交于 2021-02-08 12:46:34
问题 I wanted to add conditional formatting in the region but One method which I saw in tutorial is deprecated. What to use instead of it. Sample: ConditionalFormattingRule rule2 = sheetCF.createConditionalFormattingRule(ComparisonOperator.LT, "50"); PatternFormatting fill2 = rule2.createPatternFormatting(); fill2.setFillBackgroundColor(IndexedColors.GREEN.index); fill2.setFillPattern(PatternFormatting.SOLID_FOREGROUND); CellRangeAddress[] regions = { CellRangeAddress.valueOf("A1:A6") //DEPRECATED

Updating Waterfall Chart with Apache POI

别等时光非礼了梦想. 提交于 2021-02-08 10:51:11
问题 I am using the Apache POI Java library (v4.1.1) to create wonderfull Word documents including Excel Charts. For the Excel Charts I use an Excel template and via the Apache POI library access the charts in the Word document via List<XWPFChart> chartList = wordDoc.getCharts(); This is working fine for Bar / Column / Line etc. I can't get, however, the Waterfall chart via this method. So, I am wondering if anybody has got a solution for this? I see some options; Waiting until it is supported by

Updating Waterfall Chart with Apache POI

时光怂恿深爱的人放手 提交于 2021-02-08 10:47:29
问题 I am using the Apache POI Java library (v4.1.1) to create wonderfull Word documents including Excel Charts. For the Excel Charts I use an Excel template and via the Apache POI library access the charts in the Word document via List<XWPFChart> chartList = wordDoc.getCharts(); This is working fine for Bar / Column / Line etc. I can't get, however, the Waterfall chart via this method. So, I am wondering if anybody has got a solution for this? I see some options; Waiting until it is supported by

How to generate aggregations like sum, average at row labels instead of column labels in excel pivot table using apache poi?

不想你离开。 提交于 2021-02-08 09:38:07
问题 I am trying to produce an excel pivot table using apache-poi library. Base data What I want When i try to add multiple aggregations, excel was grouping it into values (you can see the values attribute in right side of 2nd image in row labels) and placing values in columns. I want to generate an excel with values in the row labels by default. But when i add multiple aggregations like sum and average(as shown in the below image), the values are shown in column labels. values can be dragged to