01.
fileIn =
new
FileInputStream(
"D:/programjava/new_auto_recon2009_age/Auto_Recon.xls"
);
02.
wb =
new
HSSFWorkbook(fileIn);
03.
04.
try
{
05.
sheet = wb.getSheetAt(
0
);
06.
HSSFCellStyle cellStyle = wb.createCellStyle();
07.
HSSFDataFormat cellFormat = wb.createDataFormat();
08.
HSSFFont cellFont = wb.createFont();
09.
cellFont.setFontHeightInPoints((
short
)
8.5
);
10.
cellFont.setFontName(
"MS Sans Serif"
);
11.
cellStyle.setFont(cellFont);
12.
intRow =
3
;
13.
strReportDate = PublicFunction.changeFormatDate(ReportDate);
14.
15.
for
(Iterator iter = repTsdProfiles.iterator(); iter.hasNext();) {
16.
TsdProfileInf repTsdProfile = (TsdProfileInf) iter.next();
17.
18.
19.
row = sheet.getRow(intRow);
20.
21.
cell = row.getCell((
short
)
1
);
22.
if
(cell ==
null
)
23.
cell = row.createCell((
short
)
1
);
24.
cell.setCellValue(strReportDate);
25.
cell.setCellStyle(cellStyle);
26.
27.
cell = row.getCell((
short
)
2
);
28.
if
(cell ==
null
)
29.
cell = row.createCell((
short
)
2
);
30.
cell.setCellValue(repTsdProfile.getSecSymbol());
31.
cell.setCellStyle(cellStyle);
32.
33.
cell = row.getCell((
short
)
3
);
34.
if
(cell ==
null
)
35.
cell = row.createCell((
short
)
3
);
36.
cell.setCellValue(repTsdProfile.getIsin());
37.
cell.setCellStyle(cellStyle);
38.
39.
40.
cell = row.getCell((
short
)
4
);
41.
if
(cell ==
null
)
42.
cell = row.createCell((
short
)
4
);
43.
cellStyle.setDataFormat(cellFormat.getFormat(
"#,##0.00"
));
44.
cell.setCellValue(repTsdProfile.getBalQuantity());
45.
cell.setCellStyle(cellStyle);
46.
47.
cell = row.getCell((
short
)
5
);
48.
if
(cell ==
null
)
49.
cell = row.createCell((
short
)
5
);
50.
cell.setCellValue(repTsdProfile.getPc());
51.
cell.setCellStyle(cellStyle);
52.
53.
cell = row.getCell((
short
)
6
);
54.
if
(cell ==
null
)
55.
cell = row.createCell((
short
)
6
);
56.
57.
cell.setCellValue(repTsdProfile.getPenSecdil());
58.
cell.setCellStyle(cellStyle);
59.
60.
61.
intRow++;
62.
}