首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

JXL合并SHEET页!该如何处理

2012-01-29 
JXL合并SHEET页!比如现在有3个XLS, a.xls,b.xls,c.xls每个XLS里面都只有1个SHEET页,sheeta,sheetb,sheetc

JXL合并SHEET页!
比如现在有3个XLS, a.xls,b.xls,c.xls 每个XLS里面都只有1个SHEET页,sheeta,sheetb,sheetc

请问如何把这3个sheet页,合并到d.xls中不同的sheet页。结果就是d.xls中有3个sheet页。分别是sheeta,sheetb,sheetc.

高分请教,在线等答案。。。

[解决办法]
a.xls.b.xls.c.xls都是有格式的?什么意思?是不是说每个sheet里的字段都不一样?
那也没问题,用三个的不同的类分别封装三个sheet啊!

至于有没有copy或clone的方法...不太清楚哦!
[解决办法]
看看这两个方法
importSheet
public abstract WritableSheet importSheet(java.lang.String name,
int index,
Sheet s)Imports a sheet from a different workbook. Does a deep copy on all elements within that sheet 

Parameters:
name - the name of the new sheet
index - the position for the new sheet within this workbook
sheet - the sheet (from another workbook) to merge into this one 
Returns:
the new sheet

--------------------------------------------

copySheet
public abstract void copySheet(int s,
java.lang.String name,
int index)Copy sheet within the same workbook. The sheet specified is copied to the new sheet name at the position 

Parameters:
s - the index of the sheet to copy
name - the name of the new sheet
index - the position of the new sheet

--------------------------------------------

copySheet
public abstract void copySheet(java.lang.String s,
java.lang.String name,
int index)Copies the specified sheet and places it at the index specified by the parameter 

Parameters:
s - the name of the sheet to copy
name - the name of the new sheet
index - the position of the new sheet

热点排行
Bad Request.