(2)同样的代码放在单独的main函数里调多少次都没有问题.
6 个解决方案
#1
是不是什么地方发生异常,或者说有些东西没有清
#2
可能是生成excel结束后没有关闭excel文件。
#3
关的很干净了,我发现就是往里面add cell时出错。如果只是set txt没有问题。
#4
wwb.write();抛异常,但是第一次调用没有异常,两次调用操作一模一样.第二次就越界.
public void close() {
if (wwb != null) {
try {
wwb.write();
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
try {
wwb.close();
wwb = null;
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
}
if (rwb != null) {
rwb.close();
rwb = null;
}
}
java.lang.ArrayIndexOutOfBoundsException: 13
10:37:15,515 INFO [STDOUT] at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68)
10:37:15,515 INFO [STDOUT] at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:376)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:805)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:550)
public void close() {
if (wwb != null) {
try {
wwb.write();
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
try {
wwb.close();
wwb = null;
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
}
if (rwb != null) {
rwb.close();
rwb = null;
}
}
java.lang.ArrayIndexOutOfBoundsException: 13
10:37:15,515 INFO [STDOUT] at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68)
10:37:15,515 INFO [STDOUT] at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:376)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:805)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:550)
#5
已经解决
#6
楼主如何解决的,我现在也是点第二次导出时work.write()报下标越界的错误。
#1
是不是什么地方发生异常,或者说有些东西没有清
#2
可能是生成excel结束后没有关闭excel文件。
#3
关的很干净了,我发现就是往里面add cell时出错。如果只是set txt没有问题。
#4
wwb.write();抛异常,但是第一次调用没有异常,两次调用操作一模一样.第二次就越界.
public void close() {
if (wwb != null) {
try {
wwb.write();
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
try {
wwb.close();
wwb = null;
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
}
if (rwb != null) {
rwb.close();
rwb = null;
}
}
java.lang.ArrayIndexOutOfBoundsException: 13
10:37:15,515 INFO [STDOUT] at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68)
10:37:15,515 INFO [STDOUT] at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:376)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:805)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:550)
public void close() {
if (wwb != null) {
try {
wwb.write();
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
try {
wwb.close();
wwb = null;
} catch (Exception ex) {
ex.printStackTrace(System.out);
}
}
if (rwb != null) {
rwb.close();
rwb = null;
}
}
java.lang.ArrayIndexOutOfBoundsException: 13
10:37:15,515 INFO [STDOUT] at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68)
10:37:15,515 INFO [STDOUT] at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:376)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:805)
10:37:15,515 INFO [STDOUT] at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:550)
#5
已经解决
#6
楼主如何解决的,我现在也是点第二次导出时work.write()报下标越界的错误。