jexcelapi

Java中导入、导出Excel

感情迁移 提交于 2020-12-06 09:57:44
一、介绍 当前B/S模式已成为应用开发的主流,而在企业办公系统中,常常有客户这样子要求:你要把我们的报表直接用Excel打开(电信系统、银行系统)。或者是:我们已经习惯用Excel打印。这样在我们实际的开发中,很多时候需要实现导入、导出Excel的应用。 目前,比较常用的实现Java导入、导出Excel的技术有两种Jakarta POI和Java Excel 下面我就分别讲解一下如何使用这两个技术实现导入、导出Excel 二、使用Jakarta POI导入、导出Excel Jakarta POI 是一套用于访问微软格式文档的Java API。Jakarta POI有很多组件组成,其中有用于操作Excel格式文件的HSSF和用于操作Word的HWPF,在各种组件中目前只有用于操作Excel的HSSF相对成熟。官方主页 http://poi.apache.org/index.html ,API文档 http://poi.apache.org/apidocs/index.html 2.1 环境配置 2.1.1下载jar 官方下载: http://poi.apache.org/download.html 这里可以下载到它的最新版本和文档,目前最新版本是3.7,这里使用比较稳定的3.6版。 2.1.2加入jar包 将根目录下的poi-3.6-20091214.jar和Lib目录下三个通用包

Writing Multiple CSV Files From Excel using Java and Jexcelapi

我与影子孤独终老i 提交于 2019-12-25 05:18:08
问题 I'm trying to create a program that writes all the data from excel to multiple csv files. Currently, my program creates n number of files, and only the last row of excel is being written on the last csv file. Programming Background Observation: It seems like the file is writing. But for each written row, it somehow creates the same file 250 times. It erases the row that was written last. I may have some problems using the OutputStream or BufferedWriter . I just can't figure out what it is.

Character encoding issues in Eclipse for Java using Webdriver

天涯浪子 提交于 2019-12-20 03:21:12
问题 I'm currently using Eclipse with TestNG running selenium webdriver with java. I am using Jexcelapi to import data from OpenOffice (spreadsheet) to compare strings on the website i'm testing with values in the spreadsheet. The problem I have is that we have different regions including germany and Nordics (Sweden, Norway and Denmark). These sites have string characters with accents special characters. This is copied correctly on my spreadsheet and running the scripts in debug mode shows the

how to solve JXL error : jxl.read.biff.BiffException: Unable to recognize OLE stream

心已入冬 提交于 2019-12-18 19:01:26
问题 i am trying to get cell data from my .csv file but it gets error : jxl.read.biff.BiffException: Unable to recognize OLE stream I don't understand how to solve this,please give me some solution this code is for jxl api & is that api support to .csv? Code for reference: public void read() throws IOException, BiffException { File inputWorkbook = new File(inputFile); try { w = Workbook.getWorkbook(inputWorkbook.getAbsoluteFile()); // Get the first sheet Sheet sheet = w.getSheet(0); // Loop over

Choosing an excel java api [closed]

人走茶凉 提交于 2019-12-18 04:24:23
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . All I need to do is open an MS excel sheet - not sure which kind yet (2003, 2007, etc.) - and parse the information in each row into

Why does jExcelAPI dump warnings in stderr and how to stop this behaviour?

一个人想着一个人 提交于 2019-12-14 02:33:55
问题 While trying to read an xls file using jExcelAPI, I find that the library dumps a lot of information in stderr, sometimes this information is not relevant. For example, this code snippet causes lots of 'Warnings' to be dumped on stderr stream: Workbook workbook = Workbook.getWorkbook(new File(flname)); //For each sheet in the workbook for (int currentSheet = 0; currentSheet < workbook.getNumberOfSheets(); currentSheet++) { Sheet sheet = workbook.getSheet(currentSheet); System.out.println(

JExcelApi: multiple formats in one cell?

坚强是说给别人听的谎言 提交于 2019-12-14 02:16:30
问题 In Excel, I can have multiple text styles in a single cell. Is there a way to create a file like this using JExcelApi? I'm not seeing anything so far: setCellFormat is a method on WritableCell, and there doesn't seem to be any way to set a format for anything within a single cell. Am I just missing it (quite possible!), or is this not implemented? As a bonus: how hard would this be to implement? Is there any other Excel-export library which does implement this, from which I could borrow the

Error occured in copying excel sheet with JExel API

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 06:24:17
问题 I am using JExcel (2.6.10) and I want to copy sheet . I want to create as like that Open existing Excel file (pre created it as template for don't need to add style and layout) Update or insert required fields return it as ByteArrayOutPutStream for download (user can download that excel file) My Excel file may include one or more sheet that with dynamic sheet count. I don't want to create many template file . I want to copy template and insert datas at on these copied templates. But I got

Excel file access from internal storage android app

最后都变了- 提交于 2019-12-13 00:56:02
问题 I want to be able to copy an excel file from my android app res\raw folder to the client phone's internal storage, and be able to retrieve the data from the excel file and update the excel file in the internal storage as needed. So far all I have is this: http://developer.android.com/guide/topics/data/data-storage.html#filesInternal --- write files to internal storage and http://www.vogella.com/articles/JavaExcel/article.html --- using jexcel to retrieve data from and edit an excel file I can

Reading Excel checkbox values in Java Apache POI

亡梦爱人 提交于 2019-12-12 16:55:23
问题 I have spent countless hours trying to find a solution to this. I have tried Apache POI, JExcel and JXLS but no where have I found code to successfully read checkbox (form control) values. If anyone has found a working solution then it would be great if you could share it here. Thanks! UPDATE I have written code that reads the checkbox but it cannot determine whether it is checked or not. import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io