apache-poi

How to change the graphical attributes of a point in an Excel sunburst chart through Apache POI

耗尽温柔 提交于 2019-12-11 14:26:51
问题 I have a requirement to color the different data points in an Excel sunburst chart programatically. By default, Excel creates the chart looking like this. I need to be able to make something like this. I've been able to load the chart and series, what I have not been able to work out is how to get to each of the points and change the fill color, and is that even possible. The data to create this chart is : Level 1,Level 2,Level 3,Series 1 A,A.a,A.a.1,5 A,A.a,A.a.2,5 A,A.b,A.b.1,5 A,A.b,A.b.2

How to find out excel sheet formula operator using apache poi 3.6?

荒凉一梦 提交于 2019-12-11 13:57:27
问题 I have cell formula like C1+C2.suppose i use getcellformula()method it returns the String C1+C2. Now i want to split the String by operator and get the each cell Address separately.Is there anyway to find out the Excel formula operator and get the each cell address separately. How i do? Please reply me... Saravanan.p 回答1: This answer to your other question will answer this as well. A formula =D4+D6 when parsed via FormulaParser gives org.apache.poi.hssf.record.formula.RefPtg [D4] org.apache

Zip-bomb exception while writing a large formatted Excel (.xlsx)

戏子无情 提交于 2019-12-11 13:55:25
问题 I've written a simple web app with JSF which is used to download Excel reports. I'm able to write to at least 50,000 rows with six columns onto five different sheets in under ten seconds. The problem comes when I try to format the Excel data. The formatting takes quite sometime and important thing is when I try to format Excel with data more than 3,000 rows and download through the JSF, it throws the Zip Bomb IO exception. Due to this, I'm unable to compute the size of the formatted workbook

Xml Beans 2.6 exception with Excel creation on Android

断了今生、忘了曾经 提交于 2019-12-11 13:54:42
问题 I'm trying to create .xlsx documents with the Apache POI 3.14 library. This is my Gradle config: (...) defaultConfig { applicationId "com.example.app" minSdkVersion 14 targetSdkVersion 19 multiDexEnabled true } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt') proguardFile 'Path/app/proguard-rules.pro' } } } dependencies { compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:multidex:1.0.1' //compile files('libs

Java Vector Data Grouping - Relevant Code

断了今生、忘了曾经 提交于 2019-12-11 13:54:15
问题 I am currently importing excel data into a vector in Java, however now i want to group that data so that similar data with lets say the same id is grouped (in my case matter number). here is my relevant import code: public class FileChooser extends javax.swing.JFrame { private String path =""; public FileChooser() { initComponents(); } private static Vector importExcelSheet(String fileName) { Vector cellVectorHolder = new Vector(); try { Workbook workBook = WorkbookFactory.create(new

Apache POI Excel sheet: resize a picture while keeping its ratio

馋奶兔 提交于 2019-12-11 13:42:08
问题 Hello I have created excel sheet by using POI. I've added picture(jpg-file) in the next way: Workbook wb = new HSSFWorkbook(); CreationHelper helper = wb.getCreationHelper(); //... InputStream is = new FileInputStream("img.jpg"); byte[] bytes = IOUtils.toByteArray(is); int picIdx = wb.addPicture(bytes, Workbook.PICTURE_TYPE_JPEG); Drawing drawing = sheet.createDrawingPatriarch(); ClientAnchor anchor = helper.createClientAnchor(); anchor.setCol1(5); anchor.setRow1(5); Picture pict = drawing

Excel cell displaying zero instead of a calculated / referenced value

你。 提交于 2019-12-11 13:33:02
问题 I am exporting an Excel file with Apache POI using an Excel file as source and for some cells (not all) simply referencing others (like ='worksheet2'.B13 ) or calculating a value with referenced cells (like ='worksheet2'.C13 + 'worksheet2'.D13 ), they only display zero (0) instead of the right value. Weird thing is that when I click on the formula and change something in it, as typing a space and deleting it and then I type enter, the right value is displayed ! For info, the type of those

How to get pictures with names from an xls file using Apache POI

南笙酒味 提交于 2019-12-11 13:17:03
问题 Using workbook.getAllPictures() I can get an array of picture data but unfortunately it is only the data and those objects have no methods for accessing the name of the picture or any other related information. There is a HSSFPicture class which would contain all the details of the picture but how to get for example an array of those objects from the xls? Update: Found SO question How can I find a cell, which contain a picture in apache poi which has a method for looping through all the

How to use org.apache.poi.ss.formula.FormulaParser to parse the formula?

只愿长相守 提交于 2019-12-11 13:07:47
问题 Can u give me the simple code snippt using org.apache.poi.ss.formula.FormulaParser. FormulaParser class having the method parse().But it returns ptg[].i dont know where is the ptg class... Please guide me to use formulaParse to parse the excel sheet formula... Saravanan 回答1: Ptg[] is a array of tokens which represents the formula in the cell. Suppose in my excel sheet I have as cell with a formula as =D4+D6+D8-D11+D23+D29+D46-D49 Running this through a FormulaParser gives me an array which I

Set top row and left column for an XSSFSheet

旧城冷巷雨未停 提交于 2019-12-11 12:53:35
问题 I am trying to make sure an XLSX sheet is at the top left when the file is open. The XSSFSheet has a getTopCol() and a getLeftCol() methods, but there is no setter. XSSFSheet.showInPane(int, int) does work, but only if pane is frozen or split. PaneInformation pane = sheet.getPaneInformation(); if (pane == null) { // FIXME doesn't work when there is no pane sheet.showInPane(CellAddress.A1.getRow(), CellAddress.A1.getColumn()); } else { // OK sheet.showInPane(pane.getHorizontalSplitPosition(),