01.
try
{
02.
03.
JRResultSetDataSource resultSetDataSource =
new
JRResultSetDataSource(
04.
rs);
05.
06.
07.
08.
ClassLoader classLoader = getClass().getClassLoader();
09.
File file =
new
File(classLoader.getResource(rpt).getFile());
10.
log.info(file.getAbsolutePath().replace(
"%20"
,
" "
));
11.
12.
JasperReport jr = JasperCompileManager.compileReport(file
13.
.getAbsolutePath().replace(
"%20"
,
" "
));
14.
15.
16.
JasperPrint jp = JasperFillManager.fillReport(jr,
null
,
17.
resultSetDataSource);
18.
JasperExportManager.exportReportToPdfFile(jp,
19.
cf.getString(
"outPath"
) +
"\\" + licenseno + "
.pdf");
20.
log.info(
"success : "
+ cf.getString(
"outPath"
) +
"\\"
21.
+ licenseno +
".pdf"
);
22.
23.
24.
}
catch
(Exception e) {
25.
log.error(e.toString());
26.
e.printStackTrace();
27.
28.
}