Tag: java

Apache POI透视表:不同的计数(Excel 2013)

我必须在Excel 2013中创build一个包含使用“distinct count”汇总函数的值域的Apache POI的数据透视表(例如http://datapigtechnologies.com/blog/index.php/distinct-count-in-pivot -tables-finally-in-excel-2013 / ) AFAIK它不包含在poi的DataConsolidateFunction中。 有人知道这个解决方法吗? 我目前正在使用POI版本3.14。

XSSFWorkbook共享使用EXCEL文件

我有一个由JAVA程序附加EXCEL文件共享访问的问题。 所有的工作正常,直到文件不被其他人访问,仍然打开,而程序再次运行 – 至less每10分钟。 该API告诉我像文件正在使用,不能打开写作。 通常是一个好主意,但存在一种方法来避免这种行为? 事实上,这意味着什么:一个开关,一个价值或什么特别的东西来忽略这个?

隐藏显示:显示的列:表struts并在Excel中导出

我正在开发一个Struts应用程序,并使用display:table和display:column标签创build一个带有显示标签库的表格。 我已经在一些列中添加了HTML,所以当我导出表格的HTML代码也导出到Excel工作表。 所以我得到了这个工作。 我想创build隐藏的列,而不使用HTML代码,并导出这些列,而不是包含HTML数据的列。 但我坚持隐藏列和导出隐藏的列,并防止一些列导出到Excel工作表。

使用apache poi读取excel – Hashmap,ArrayList

嗨, 我想在Excel中使用列标题(使用Java)读取列值。 如图所示,假设我想要读取标题“城市”,列下的所有后续单元格,并显示它们。 我将如何做到这一点? 通过互联网看的例子,我发现大部分的例子迭代使用迭代器的行。 假设我有一个key的hashmap作为excel的头文件和后来的值存储在ArrayList中。 就像是 HashMap<String, ArrayList<String>> hashmap = new HashMap<String, ArrayList<String>>(); 我应该如何继续? 任何人都可以帮助我的代码和逻辑? 请不要将其标记为重复,我已经尝试过在stackoverflow和internet上search,但是其中大多数使用该行进行迭代。

在TomCat上运行的POI导致加载程序约束违规

我正在尝试使用Apache POI生成XSLX,但在尝试运行TomCat应用程序时出现此错误: HTTP Status 500 – javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method "org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument.copy()Lorg/apache/xmlbeans/XmlObject;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/apache/poi/POIXMLProperties, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, org/openxmlformats/schemas/officeDocument/x2006/extendedProperties/PropertiesDocument, have different Class objects for the type ts.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument.copy()Lorg/apache/xmlbeans/XmlObject; used in the signature 我正在使用POI 3.15。 POI JARs存储在通用的Tomcat7 / […]

java.lang.OutOfMemoryError:使用XLSReader将Excel文件读入java bean时的Java堆空间

我得到java.lang.OutOfMemoryError:在使用XLSReader读取Excel文件到Java bean时的Java堆空间 这是代码片段。 public static <T> List<T> parseExcelFileToBeans(final File xlsFile, final File jxlsConfigFile) throws Exception { final XLSReader xlsReader = ReaderBuilder.buildFromXML(jxlsConfigFile); final List<T> result = new ArrayList<>(); final Map<String, Object> beans = new HashMap<>(); beans.put("result", result); try (InputStream inputStream = new BufferedInputStream(new FileInputStream(xlsFile))) { xlsReader.read(inputStream, beans); } return result; }

如何使用apche POI在excel中只读专栏

我正在使用apache poi生成一个excel文件,而且我想只在该excel文件中使最后两列读取。 所以我尝试了poi的lockingfunction,但是它使得所有的单元只读,我想在最后两个只读。在这里,我发布了我迄今为止所做的 HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); sheet.protectSheet("password"); HSSFRow row = null; HSSFCell cell = null; /* cell style for locking */ CellStyle lockedCellStyle = wb.createCellStyle(); lockedCellStyle.setLocked(true); /* cell style for editable cells */ CellStyle unlockedCellStyle = wb.createCellStyle(); unlockedCellStyle.setLocked(false); cell = row.createCell(columnNo); if (null != taskDiaryItem.getDueDate()) { SimpleDateFormat formater = […]

JFileChooser和使用JAVA从Excel文件读取

我有一个下面的代码 import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.text.html.HTMLDocument.Iterator; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Workbook; public class ExcelRead { public static String keep = ""; public static void main(String[] args) throws IOException { // File […]

Apache-poi限制用户只select下拉列表的值

我怎样才能让用户只select下拉列表中的一个值,而不是在Excel工作表中input自己的值。 我正在使用Java库Apache-POI

Robot Framework和Selenium调用java方法

我devise了一个机器人脚本来testingSelenium的网页。 执行脚本后,Selenium将生成log.html和report.html,它提供了一些关于testing的反馈。 不过,我想输出像Excel格式。 我使用Java从apachefind了EXCEL库。 我如何收集信息并致电图书馆输出excel?