如何实现表格行和列的动态插入、删除,以及对单元格内容的设置???

jacky884 2007-06-21 09:08:51
大虾们好:
小弟现在需要编写入标题所言的特效,经过查阅相关资料,发现有insertRow等函数,但是不知道如何使用。请大家帮忙。

我的程序不是用JSP实现的,而是编写的APPLET。所用数据库SQL SERVER。
那位大侠帮帮我,十分感谢!
...全文
384 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
北京朝五晚九 2007-06-26
  • 打赏
  • 举报
回复
jsp 的,我可以用JavaScript实现,但是你说得我没有用过!
志大洋 2007-06-26
  • 打赏
  • 举报
回复
wb.setPrintArea(0, 0, 14, 0, 3 );
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
wb.write(byteArrayOut);
byteArrayOut.close();
fin.close();
志大洋 2007-06-26
  • 打赏
  • 举报
回复
用EXCEL?
import org.apache.commons.beanutils.DynaBean;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor.BLACK;
import org.apache.poi.hssf.util.HSSFColor.LIGHT_YELLOW;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

String strTempFileNm = "d:/template.xls";
FileInputStream fin = new java.io.FileInputStream(strTempFileNm);
POIFSFileSystem fs = new org.apache.poi.poifs.filesystem.POIFSFileSystem(fin);
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
wb.setSheetName(0,"MY SHEET1",HSSFCell.ENCODING_UTF_16);
HSSFRow row;
HSSFCell cell;
HSSFFont fontSize9 = wb.createFont();
HSSFCellStyle cellStyleYellow4Right = wb.createCellStyle();
cellStyleYellow4Right.setFillForegroundColor(LIGHT_YELLOW.index);
cellStyleYellow4Right.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
cellStyleYellow4Right.setBorderBottom(HSSFCellStyle.BORDER_THIN);
cellStyleYellow4Right.setBottomBorderColor(BLACK.index);
cellStyleYellow4Right.setBorderLeft(HSSFCellStyle.BORDER_THIN);
cellStyleYellow4Right.setLeftBorderColor(BLACK.index);
cellStyleYellow4Right.setBorderRight(HSSFCellStyle.BORDER_THIN);
cellStyleYellow4Right.setRightBorderColor(BLACK.index);
cellStyleYellow4Right.setBorderTop(HSSFCellStyle.BORDER_THIN);
cellStyleYellow4Right.setTopBorderColor(BLACK.index);
cellStyleYellow4Right.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP );
cellStyleYellow4Right.setAlignment(HSSFCellStyle.ALIGN_RIGHT );
cellStyleYellow4Right.setWrapText(true);
cellStyleYellow4Right.setFont(fontSize10);

row = sheet.getRow(0);
cell = row.getCell((short) 0);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
tdy1234 2007-06-25
  • 打赏
  • 举报
回复
不懂帮顶
SADOCom 2007-06-25
  • 打赏
  • 举报
回复
用servlet试一下吧...
zhmt 2007-06-22
  • 打赏
  • 举报
回复
拉把椅子上帮"jacky884()"顶,
呵呵
yingzi107 2007-06-22
  • 打赏
  • 举报
回复
程序员群 41801837

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧