apache-poi

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFWorkbook.createDataFormat()Lorg/apache/poi/hssf/usermodel/HSSFDataFormat;

爷,独闯天下 提交于 2019-12-05 09:53:33
I have some troubles to export my report as XLS . The export as PDF works well. So I tried to update to the latest JasperReports and Apache POI version: JasperReports: 5.5.0 POI: 3.7 iText: 2.1.7 But I receive always following exception: java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFWorkbook.createDataFormat()Lorg/apache/poi/hssf/usermodel/HSSFDataFormat; net.sf.jasperreports.engine.export.JRXlsExporter.openWorkbook(JRXlsExporter.java:284) net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:927) net.sf.jasperreports.engine

How to split a excel file into multiple files based on row count using apache poi?

依然范特西╮ 提交于 2019-12-05 09:19:04
I am new to apache poi, I wanted to split a excel file into multiple files based on row count. E.g data.xlsx has 15k rows, new files should be like data_1.xlsx with 5k rows,data_2.xlsx should be 5-10k and data_3.xlsx should be 10-15k. I've got you. package com.industries.seanimus; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.poi.EncryptedDocumentException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache

Write large text file data into excel

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 09:11:18
I am reading a text file separated with some delimiters. Example of my text file content Avc def efg jksjd 1 2 3 5 3 4 6 0 line by line and holding it in memory using hashmap having line numbers as key of integer type and each line of text file as List object Consider, my map would store information like this Integer List 1 [Avc def efg jksjd] I am using Apache POI to write into excel. When writing into excel using Apache POI, I am following this approach, here is my code snippet HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("Sample sheet"); Map<Integer,

Apache POI, calling autosize after auto filter

只愿长相守 提交于 2019-12-05 08:33:20
I have been searching for a while, and haven't been able to find a solution as yet. This question has been asked before on here but the OP didn't get a response and I didn't want to resurrect an old thread so decided on asking a new question. The OP thread is here . The problem I'm having is that I've got a spreadsheet which is created with data obtained from a database, however sometimes the data within cells can be quite lengthy, so wanted POI to autosize to save the user having to do it, but because I'm setting autofilter before calling autosize, it's not quite working. I'm using Apache POI

What is the C# equivalent of Apache POI api?

孤者浪人 提交于 2019-12-05 07:58:18
I have a need to replicate a framework I built ij Java using the Apache POI api to read data from MS Excel. I have no idea what to use that is an equivalent of apache POI library. Any ideas please anyone? It depends on what you want to do. One option is NPOI , which is a .Net port of Apache POI to .Net Another option is to use IKVM , and then Apache POI itself directly from within .Net. shadeglare You could use Open XML SDK for manipulating MS Office document formats since Office 2007. 来源: https://stackoverflow.com/questions/12300915/what-is-the-c-sharp-equivalent-of-apache-poi-api

POI Excel Merging Causing “Repaired Records: Format from /xl/styles.xml part (Styles)”

微笑、不失礼 提交于 2019-12-05 07:52:18
I have merged two excel files using the code specied here http://www.coderanch.com/t/614715/Web-Services/java/merge-excel-files this the block applying the styles for my merging cells if (styleMap != null) { if (oldCell.getSheet().getWorkbook() == newCell.getSheet().getWorkbook()) { newCell.setCellStyle(oldCell.getCellStyle()); } else { int stHashCode = oldCell.getCellStyle().hashCode(); XSSFCellStyle newCellStyle = styleMap.get(stHashCode); if (newCellStyle == null) { newCellStyle = newCell.getSheet().getWorkbook().createCellStyle(); newCellStyle.cloneStyleFrom(oldCell.getCellStyle());

Reading equations & formula from Word (Docx) to html and save database using java

◇◆丶佛笑我妖孽 提交于 2019-12-05 07:21:13
问题 I have a word/docx file which has equations as under images I want read data of file word/docx and save to my database and when need I can get data from database and show on my html page I used apache Poi for read data form docx file but It can't take equations Please help me! 回答1: Word *.docx files are ZIP archives containing XML files which are Office Open XML. The formulas contained in Word *.docx documents are Office MathML (OMML). Unfortunately this XML format is not really well known

Creating cell comments in apache poi (for .xlsx files) with show comments disabled

不打扰是莪最后的温柔 提交于 2019-12-05 06:16:33
I am trying to create cells comments using apache poi. I am able to create the comments, but by default they are always displayed in excel. I have to manual right click on the cell and un-tick show comments to make them invisible(now they appear only when I hover on the cell). Is it possible to make cell comments invisible by default(so that they don't appear in the excel until user hover over the cell.) Here is the code I used : Drawing drawing = cell.getSheet().createDrawingPatriarch(); CreationHelper factory = cell.getSheet().getWorkbook().getCreationHelper(); ClientAnchor anchor = factory

How to merge cells (or apply colspan) using XWPFTable in POI in Java?

帅比萌擦擦* 提交于 2019-12-05 06:04:25
Creating a table in poi was quite easy but it has very limited tutorials and I cannot find one that can create a simple merged cell in a table in generating a docx file. If you have created table, row inside a table and cell inside a row, you can add gridSpan to cell properties: if (cell.getCTTc().getTcPr() == null) cell.getCTTc().addNewTcPr(); if (cell.getCTTc().getTcPr().getGridSpan() == null) cell.getCTTc().getTcPr().addNewGridSpan(); cell.getCTTc().getTcPr().getGridSpan().setVal(2); Note: cell is org.apache.poi.xwpf.usermodel.XWPFTableCell. Creating a separate XWPFTable for each table row

Evaluation from Apache POI and JExcel Api

点点圈 提交于 2019-12-05 05:48:50
问题 I need create Excel woorkbooks in Grails, Grails support both Apache POI and JExcel Api, but I would like you to tell me about the advantages and disadvantages of both. According to I know, Apache POI is more faster than JExcel Api, but the JExcel API have a mos friendly code. Please if do you tell me about your experience. Thanks 回答1: A couple of differences: JExcel is limited to Office 2003 formats whereas POI supports the 2007/2010 format (xlsx) In many cases Jexcel is a whole lot less