本文整理汇总了Java中jxl.write.biff.RowsExceededException类的典型用法代码示例。如果您正苦于以下问题:Java RowsExceededException类的具体用法?Java RowsExceededException怎么用?Java RowsExceededException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RowsExceededException类属于jxl.write.biff包,在下文中一共展示了RowsExceededException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readExcel
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
public static void readExcel(String inputfileName, String outputfileName) throws BiffException, IOException , RowsExceededException, WriteException{
Workbook wb=Workbook.getWorkbook(new File(inputfileName));
Sheet sheet = wb.getSheet(0); //get sheet(0)
WritableWorkbook wwb = Workbook.createWorkbook(new File(outputfileName));
WritableSheet ws = wwb.createSheet("topicName", 0);
//traversal
for(int i=0; i<sheet.getRows(); i++)
{
String content = sheet.getCell(0,i).getContents();
String[] words = content.split("\\(");
content = words[0];
content = content.toLowerCase();
content = content.replaceAll("_", " ");
content = content.replaceAll("-", " ");
content = content.replaceAll("\\s+", " ");
if(content.contains("data structure") && !content.trim().equals("data structure"))
content = content.replaceAll("data structure", "");
Label labelC = new Label(0, i, content.trim());
ws.addCell(labelC);
}
wwb.write();
wwb.close();
}
示例2: addMultipleLabelsWrap
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
private void addMultipleLabelsWrap(WritableSheet sheet, int col, int row, String s[], WritableCellFormat format) throws RowsExceededException, WriteException {
if (sheet==null || s==null)
return;
if (s.length==0)
return;
if (s.length==1)
sheet.addCell(new Label(col,row,s[0],format));
else {
String result = s[0];
for (int i=1; i<s.length; i++)
//result = result + ", " + s[i];
result = result + "\n" + s[i];
sheet.addCell(new Label(col,row,result,format));
}
}
示例3: addNumber
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
private void addNumber(WritableSheet sheet, int col, int row, String s[], int index, WritableCellFormat format) throws RowsExceededException, WriteException {
if (sheet==null || s==null)
return;
if (index>=s.length)
return;
double d;
try {
d = Double.parseDouble(s[index]);
// Only keep 2 digits: avoid rounding errors
d = 1d*(int)(d*100)/100;
sheet.addCell(new Number(col,row,d,format));
} catch (NumberFormatException nfe) {}
}
示例4: addNumberDiv1024
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
private void addNumberDiv1024(WritableSheet sheet, int col, int row, String s[], int index, WritableCellFormat format) throws RowsExceededException, WriteException {
if (sheet==null || s==null)
return;
if (index>=s.length)
return;
double d;
try {
d = Double.parseDouble(s[index]);
d = d / 1024;
// Only keep 2 digits: avoid rounding errors
d = 1d*(int)(d*100)/100;
sheet.addCell(new Number(col,row,d,format));
} catch (NumberFormatException nfe) {}
}
示例5: writeCell
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
/**
* @param columnPosition - column to place new cell in
* @param rowPosition - row to place new cell in
* @param contents - string value to place in cell
* @param headerCell - whether to give this cell special formatting
* @param sheet - WritableSheet to place cell in
* @throws RowsExceededException - thrown if adding cell exceeds .xls row limit
* @throws WriteException - Idunno, might be thrown
*/
public void writeCell(int columnPosition, int rowPosition, String contents, boolean headerCell,
WritableSheet sheet) throws RowsExceededException, WriteException{
//create a new cell with contents at position
Label newCell = new Label(columnPosition,rowPosition,contents);
if (headerCell){
//give header cells size 10 Arial bolded
WritableFont headerFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
WritableCellFormat headerFormat = new WritableCellFormat(headerFont);
//center align the cells' contents
headerFormat.setAlignment(Alignment.CENTRE);
newCell.setCellFormat(headerFormat);
}
sheet.addCell(newCell);
}
示例6: writeWorkbook
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
public void writeWorkbook(WritableWorkbook workbook,
Iterator<T> iter)
throws RowsExceededException, WriteException
{
WritableSheet sheet = null;
int i = 0;
while (iter.hasNext()) {
if (i % MAX_DATA_ROWS == 0) {
sheet = createSheet(workbook);
}
writeRow(i, sheet, iter.next());
++i;
if (i % 1000 == 0) {
if (log.isDebugEnabled()) {
log.debug("wrote " + i + " rows to workbook");
}
}
}
}
示例7: main
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
public static void main(String file_path[]) throws IOException, BiffException, RowsExceededException, WriteException
{
String InputFileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\数据结构上下位关系.xls";
String OutputfileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\数据结构上下位关系-子连父new.xls";
hyponymyFilter(InputFileName, OutputfileName);
System.out.println("done");
}
示例8: main
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
public static void main(String[] args) throws IOException, RowsExceededException, BiffException, WriteException
{
String InputFileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\topicPredicate.xls";
String OutputFileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\subjectPredicate.xls";
procExcel(InputFileName, OutputFileName);
System.out.println("done");
}
示例9: main
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
public static void main(String file_path[]) throws IOException, BiffException, RowsExceededException, WriteException
{
String InputFileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\Data_structure_topics.xls";
String OutputFileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\Data_structure_topics_filter.xls";
readExcel(InputFileName, OutputFileName);
System.out.println("done");
}
示例10: main
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
public static void main(String[] args) throws IOException, RowsExceededException, BiffException, WriteException
{
String oriPath = "E:\\我是研究生\\任务\\分面树的生成\\Content\\";
// String OutputFileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\hyponymyExtract.xls";
// hyponymyExtract(oriPath, oriPath + "otherFiles\\hyponymyExtract.xls");
moveOnceFacet(oriPath + "otherFiles\\hyponymyExtract.xls", oriPath + "otherFiles\\hyponymyExtract_onceFilter.xls");
System.out.println("done");
}
示例11: main
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
public static void main(String file_path[]) throws IOException, BiffException, RowsExceededException, WriteException
{
String InputFileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\数据结构上下位关系-子连父new.xls";
String OutputfileName = "E:\\我是研究生\\任务\\分面树的生成\\Content\\otherFiles\\数据结构上下位关系-use.xls";
hyponymyFilter(InputFileName, OutputfileName);
System.out.println("done");
}
示例12: addLabel
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
private int addLabel(WritableSheet sheet, int col, int row, String s, WritableCellFormat format) throws RowsExceededException, WriteException {
if (s==null){
sheet.addCell(new Label(col,row,null,format));
return 0;
}
sheet.addCell(new Label(col,row,s,format));
return s.length();
}
示例13: addMultipleLabels
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
private void addMultipleLabels(WritableSheet sheet, int col, int row, String s[], WritableCellFormat format) throws RowsExceededException, WriteException {
if (sheet==null || s==null)
return;
if (s.length==1)
sheet.addCell(new Label(col,row,s[0],format));
else {
String result = s[0];
for (int i=1; i<s.length; i++)
result = result + ", " + s[i];
sheet.addCell(new Label(col,row,result,format));
}
}
示例14: addLabel
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
private void addLabel(HSSFSheet sheet, HSSFCellStyle style,
int column, HSSFRow row, String value)
throws WriteException, RowsExceededException {
HSSFCell cell = row.createCell(column, HSSFCell.CELL_TYPE_STRING);
cell.setCellStyle(style);
cell.setCellValue(value);
}
示例15: fillSheet
import jxl.write.biff.RowsExceededException; //导入依赖的package包/类
private static void fillSheet(WritableSheet sheet, SortedMap<java.lang.Number, java.lang.Number> data)
throws WriteException, RowsExceededException {
int row = 0;
for (java.lang.Number x : data.keySet()) {
// first column
addNumber(sheet, 0, row, x);
// second column
addNumber(sheet, 1, row++, data.get(x));
}
}