请问jxl该如何安装?

解决方案 »

  1.   

    jxl 不是安装的,是直接用的jar包...
      

  2.   

    就好象 java.lang.String 一样,只要把jxl导入工程就能用了.
      

  3.   

    jxl导出excel文件   
      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();   
      }
      

  4.   

    说错了,
    下了个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
      

  5.   

    直接放在WEB-IF/lib目录下就可以吧
      

  6.   

    特别感谢
    yougucao379548695(郑州-小刘)
    问题还没解决,在开帖算了.
      

  7.   

    "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我总是报这样的错误,不知道是哪里的问题