-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExcelutils.java
More file actions
27 lines (22 loc) · 772 Bytes
/
Excelutils.java
File metadata and controls
27 lines (22 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package utils;
import java.util.List;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Workbook;
import com.nxdcms.entity.Subcompetition;
public class Excelutils {
public static void export(List<Subcompetition> list,Workbook wb){
int rowIndex=0;
org.apache.poi.ss.usermodel.Sheet sheet = wb.createSheet();
java.util.Iterator<Subcompetition> it = list.iterator();
org.apache.poi.ss.usermodel.Row row;
while (it.hasNext()) {
row=sheet.createRow(rowIndex++);
Cell cell=row.createCell(0);
Subcompetition subcompetition = it.next();
//System.out.println(subcompetition.getId());
cell.setCellValue(subcompetition.getCollege());
cell=row.createCell(1);
cell.setCellValue(subcompetition.getSubcompid());
}
}
}