开发者

How to delete a row from an Existing Excel Sheet using JXL

I am not able to delete row of an existing excel sheet using JXL.

Are开发者_JAVA百科 there any other way to delete a row from and existing workbook?


for (int i = endLine -1 ; i >= startLine -1 ; i--) { wSheet.removeRow(i);}

Remember that the JXL will elevate all the following lines when this line is deleted, so try to delete lines backwards in order to avoid the alternative deletion.


Try this:

 WritableWorkbook wb = Workbook.createWorkbook(new   File("output.xls"));
   WritableSheet sheet = wb.getSheet("some sheet");

   //delete row 10

   sheet.removeRow(10);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜