说错了, 下了个jexelapi2.6.3 里面有个jxl.jar,是不是把jxl.jar放到WEB-IF/lib目录下,然后设置classpath的...web-if/lib/jxl.jar吗,好象不行,我在jsp页面导入了jxl.*,还是报错: An error occurred at line: 104 in the jsp file: /manage/pic_id.jsp Generated servlet error: The method createWorkbook(FileOutputStream) is undefined for the type WritableWorkbookAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp Generated servlet error: WritableFont.ARIAL cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp Generated servlet error: WritableFont.BOLD cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp Generated servlet error: UnderlineStyle.NO_UNDERLINE cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp Generated servlet error: RowsExceededException cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp Generated servlet error: WriteException cannot be resolved to a type
直接放在WEB-IF/lib目录下就可以吧
特别感谢 yougucao379548695(郑州-小刘) 问题还没解决,在开帖算了.
"CreateXLS.java": cannot access jxl.Cell; bad class file: C:\Borland\JBuilder2006\thirdparty\excel\jxl.jar\jxl\Cell.class, class file has wrong version 50.0, should be 49.0, Please remove or make sure it appears in the correct subdirectory of the classpath. at line 8, column 12我总是报这样的错误,不知道是哪里的问题
public void exportExcelFile(String outputFile, List dataList) throws Exception
{
//创建工作表与sheet的引用
WritableWorkbook wb = null;
WritableSheet ws = null;
//直接根据输出的文件创建工作表对象
wb = Workbook.createWorkbook(new File(outputFile));
//创建第一页的sheet
ws = wb.createSheet("sheet1", 0);
//循环导出数据
for (int rowId = 0; rowId < dataList.size(); rowId++)
{
//得到对应行的数据列表
List valueList = (List) dataList.get(rowId);
//循环每一个单元格
for (int column = 0; column < valueList.size(); column++)
{
//得到对应单元格的值
String value = (String) valueList.get(column);
//设置值
Label label = new Label(column, rowId, value);
//加到sheet上
ws.addCell(label);
}
}
//输出到文件
wb.write();
//关闭文件
wb.close();
}
下了个jexelapi2.6.3 里面有个jxl.jar,是不是把jxl.jar放到WEB-IF/lib目录下,然后设置classpath的...web-if/lib/jxl.jar吗,好象不行,我在jsp页面导入了jxl.*,还是报错:
An error occurred at line: 104 in the jsp file: /manage/pic_id.jsp
Generated servlet error:
The method createWorkbook(FileOutputStream) is undefined for the type WritableWorkbookAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp
Generated servlet error:
WritableFont.ARIAL cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp
Generated servlet error:
WritableFont.BOLD cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp
Generated servlet error:
UnderlineStyle.NO_UNDERLINE cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp
Generated servlet error:
RowsExceededException cannot be resolved to a typeAn error occurred at line: 104 in the jsp file: /manage/pic_id.jsp
Generated servlet error:
WriteException cannot be resolved to a type
yougucao379548695(郑州-小刘)
问题还没解决,在开帖算了.