apache-poi

How to change the pivot table style from default blue to other colors using apache-poi

爱⌒轻易说出口 提交于 2019-12-24 06:24:07
问题 When i create a pivot table using the below code, it comes with some default template style(blue). How to change this default style of pivot table using apache-poi library pivotTable = sheet2.createPivotTable(aref, new CellReference("A4"), sheet1); What I want. What i am able to generate through code 回答1: XXSPivotTable is using named style PivotStyleLight16 per default. See setDefaultPivotTableDefinition. There is no method for changing this in high level XSSF classes until now. Bu we can get

How to IKVM Apache POI

风格不统一 提交于 2019-12-24 05:43:54
问题 I want to use Apache POI in my .NET application, I know there is a port NPOI but it's not complete and don't have PowerPoint related functionality. I've tried to IKVM it by using the following command: ikvmc -target:library poi-3.8.jar poi-ooxml-3.8.jar poi-ooxml-schemas-3.8.jar poi-excelant-3.8.jar poi-scratchpad-3.8.jar but when after using the classes in resulting dll I've executed the application, got this error: The type initializer for 'org.apache.poi.xslf.usermodel.XMLSlideShow' threw

How to convert doc to docx using Tika or POI?

折月煮酒 提交于 2019-12-24 05:06:07
问题 Can Anyone help me to convert a .doc file to .docx using apache Tika or with apache POI? I tried a lot of ways but stuck in converting the document to docx format. Help is appreciated. Thanks and Regards, Arun R S 回答1: I am doing this recently. And I use aspose words to convert .doc to .docx . Very convenience. Document doc = new Document(filePath); doc.save(descFilePath); Just two lines. 来源: https://stackoverflow.com/questions/23886205/how-to-convert-doc-to-docx-using-tika-or-poi

Merge and Color style not applying in Apache POI excel 2003 format

牧云@^-^@ 提交于 2019-12-24 04:42:06
问题 In Apache POI, I have apply some styles for some cells and merged those cells. When I open in 2010 or 2007 its works fine, but in 2003 the formatting style is gone. It thorws the compatibility check dialog before saving the 2003 excel file each time. Please refer the screen shot. Below is the sample code : ......... style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); style.setFillPattern(CellStyle.SOLID_FOREGROUND); ......... cell.setCellStyle(style); merging the cells

How to update Excel sheet links using poi

北城以北 提交于 2019-12-24 04:10:35
问题 I'm trying to get updated cell values after use setForceFormulaRecal method. But I'm getting still old values. Which is not actual result. If I opened Original file by clicking It will asking update Links dialogue box. If I click "ok" button then Its updating all cell formula result. So I want to update excel sheet links before its open by using poi. Please help in this situation. //Before Setting values HSSFCell cel2=row1.getCell(2); HSSFCell cel4=row1.getCell(5); cel2.setCellValue(690);

How to extract formatting information of word document using Apache POI?

孤人 提交于 2019-12-24 03:43:23
问题 I am using Apache POI for extracting formatting information from MS word files. I want to extract information like whether paragraph is having bullet, background color, forecolor, alignment, etc. There is not much documentation or tutorials available for this. Javadoc also does not contain much helpful information. Where can I get tutorials/good documentation which can help me in learning Apache POI API?? 回答1: For HWPF (.doc), the classes you probably want are: http://poi.apache.org/apidocs

Why Excel treating cells as protected even if they are not?

倾然丶 夕夏残阳落幕 提交于 2019-12-24 03:27:17
问题 I have provided protection and also hide the sheet 'MasterData' out of which I have created some named range which i have used in second sheet 'customerAssets'. Here is code snippet : workbook.setSheetHidden(0, true); //to hides masterData workbook.setActiveSheet(1); // sets active sheet as Customer Assets Sheet masterDataSheet.protectSheet("12345"); // protect MasterData sheet But after opening excel: enter image description here It doesnt allow to edit "Customer Assets" sheet saying its

Get picture position in Apache POI from Excel xls HSSF

北城以北 提交于 2019-12-24 02:25:28
问题 My need is to get a picture data as bytes, then it's anchor details and finaly display the result on screen at target position and size for my users... The API shows we can get a list of all pictures through workbook object like this: List<HSSFPictureData> picturesData = workbook.getAllPictures(); and also we are able to fetch all anchors details (see HSSFClientAnchor details here). Problem is HSSFPicture.getPictureIndex() refered by an anchor does not match HSSFPictureData collection index

org.apache.poi.POIXMLException Strict OOXML isn't currently supported, please see bug #57699

左心房为你撑大大i 提交于 2019-12-24 01:55:14
问题 I'd like to parse an Excel file with java, so I'm using apache poi libraries, here you are the maven dependencies: <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.14</version> </dependency> This will include a series of dependencies: poi-ooxml-3.14.jar poi-3.14.jar commons-codec-1.10.jar poi-ooxml-schemas-3.14.jar xmlbeans-2.6.0.jar stax-api-1.0.1.jar curvesapi-1.03.jar When I try to read an Office 365 Excel file (.xslx) with this code: import org

opening excel ooxml 2007 xlsx document returns nullPointer exception

六月ゝ 毕业季﹏ 提交于 2019-12-24 01:45:17
问题 How do I open a 2007 xlsx ooxml file with Apache POI? I've added everything to my class path but keep getting this java.lang.NullPointerException error: "C:\Program Files\Java\jdk1.7.0_13\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:1804,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.7.0_13\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_13\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_13\jre\lib\javaws.jar;C:\Program Files\Java\jdk1