本文介绍了"包装应包含的内容类型的一部分[M1.13] QUOT;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图写一个Excel文件,但是我不断收到错误:
From what I understand I am missing a jar file.
Can anyone help me identify which file it is?
P.S. I am using Netbeans.
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.swing.JOptionPane;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
*
* @author nicholaskissaun
*/
public class Tester {
public static void main (String args \[\])throws FileNotFoundException, IOException, InvalidFormatException{
int RowCount = 7, iChoice;
String sChoice;
XSSFSheet s;
XSSFRow row1;
XSSFWorkbook wb;
XSSFCell r1c1, r1c2, r1c8, r1Episodes;
FileInputStream fis = new FileInputStream("/Users/nicholaskissaun/Google Drive/Grade 11_12/Computer Science/Java/Term1/src/IA/Profiles/Becky/ShowDetails.xlsx");
wb = new XSSFWorkbook(fis);
s = wb.getSheetAt(0);
}
}
解决方案
CHECK EXCEL FORMAT .... Firstly I created an sample excel with poi and I changed the columns with mine first attempt it give same error but after few try it successfully read .I wonder why it didn't worked first run :(but If you have right library please check the correct excel format
这篇关于"包装应包含的内容类型的一部分[M1.13] QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!