91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-11
  • 語言: Java
  • 標(biāo)簽:

資源簡介

jsp讀取Excel中的數(shù)據(jù),以表格形式展現(xiàn)出來,字體,背景,都可以讀取出來

資源截圖

代碼片段和文件信息

package?com.td.bean;
import?jxl.Cell;
import?jxl.Range;
import?jxl.Sheet;
public?class?SuppXlsbean{
private?int?topleft_row?;?//起始行?
private?int?topleft_column;?//起始列?
private?int?bottomright_row?=?0;?//終止行?
private?int?bottomright_column?=?0;?//終止列?
private?int?rowspan?=?1;?//行?
private?int?colspan?=?1;?//列?
private?Range[]?ranges?=?null;?//合并單元格集合?
private?int?min_row?;?//最小行?
private?int?max_row?;?//最大行?
private?int?min_column;?//最小列?
private?int?max_column;?//最大列?
/**?
*?獲取本sheet里合并單元格的集合?
*?@param?sheet?
*/?
public?void?ReadRange(Sheet?sheetint?rowint?column){?
ranges?=?sheet.getMergedCells();?
for(Range?space:ranges){?
this.topleft_row?=?space.getTopLeft().getRow();?
this.topleft_column?=?space.getTopLeft().getColumn();?
if(row?!=?topleft_row?||?column?!=?topleft_column){?
this.setRowspan(1);?
this.setColspan(1);?
}?
if(row?==?topleft_row?&&?column?==?topleft_column){?
this.setTopleft_row(this.topleft_row);?
this.setTopleft_column(this.topleft_column);?
this.setBottomright_row(space.getBottomRight().getRow());?
this.setBottomright_column(space.getBottomRight().getColumn());?
this.setRowspan(2);?
this.setColspan(2);?
break;?
}?

}?
}?
/**?
*?
*?@return?
*/?
public?void?setBetweenRowColumn(int?row?int?column){?
for(Range?space:ranges){?
//獲取行的范圍?
int?min_row?=?space.getTopLeft().getRow();?//?min?row?
int?max_row?=?space.getBottomRight().getRow();?//?max?row?
int?min_column?=?space.getTopLeft().getColumn();?//?min?column?
int?max_column?=?space.getBottomRight().getColumn();?//?max?column?
if(min_row?<=?row?
&&?row?<=?max_row){?
//獲取列的范圍?
if(min_column?<=?column?
&&?column?<=?max_column){?
this.setMin_row(min_row);?//?min?row?
this.setMax_row(max_row);?//?max?row?
this.setMin_column(min_column);?//?min?column?
this.setMax_column(max_column);?//?max?column?
break;?
}?
}?
}?
}?
/**?
*?獲取背景顏色的值?
*?@param?cell:?當(dāng)前單元格?
*?@return?
*/?
public?String?getBgcolor(Cell?cell){?
int?r?=?cell.getCellFormat().getBackgroundColour().getDefaultRed();?
int?g?=?cell.getCellFormat().getBackgroundColour().getDefaultGreen();?
int?b?=?cell.getCellFormat().getBackgroundColour().getDefaultBlue();?
return?“#“+Integer.toHexString(r<<16|g<<8|b);?
}?
/**?
*?獲取字體的顏色?
*?@param?cell:?當(dāng)前單元格?
*?@return?
*/?
public?String?getFontColor(Cell?cell){?
int?r?=?cell.getCellFormat().getFont().getColour().getDefaultBlue();?
int?g?=?cell.getCellFormat().getFont().getColour().getDefaultGreen();?
int?b?=?cell.getCellFormat().getFont().getColour().getDefaultBlue();?
return?“#“+Integer.toHexString(r<<16|g<<8|b);?
}?
public?int?getTopleft_row()?{?
return?topleft_row;?
}?
public?void?setTopleft_row(int?topleft_row)?{?
this.topleft_row?=?topleft_row;?
}?
public?int?getTopleft_column()?{?
return?topleft_column;?
}?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-09-03?16:29??jsp讀取Excel的數(shù)據(jù)\
?????文件????????2363??2012-09-03?15:38??jsp讀取Excel的數(shù)據(jù)\suppxls.jsp
?????文件????????4948??2012-09-03?15:38??jsp讀取Excel的數(shù)據(jù)\SuppXlsbean.java

評論

共有 條評論

相關(guān)資源