엑셀 파일의 셀 너비 자동 설정

master
mjkhan21 4 months ago
parent 79dfb2ee52
commit e71cf73454

@ -48,7 +48,7 @@ public class LoggingController extends AbstractController {
if (!download)
setFetchSize(req);
else
req.setPageNum(0).setFetchSize(0);
req.setFetchAll(true);
String
toDate = req.getToDate(),
@ -97,18 +97,20 @@ public class LoggingController extends AbstractController {
private ModelAndView download(List<DataObject> list) {
List<CellDef> cellDefs = List.of(
new CellDef().setLabel("계정").setField("USER_ACNT").setWidth(10),
new CellDef().setLabel("계정").setField("USER_ACNT"),
new CellDef().setLabel("사용자이름").setField("USER_NM").setWidth(16),
new CellDef().setLabel("IP 주소").setField("IP_ADDR").setWidth(16),
new CellDef().setLabel("IP 주소").setField("IP_ADDR"),
new CellDef().setLabel("로그유형").setField("LOG_TYPE_NM").setWidth(16),
new CellDef().setLabel("접속일시").setField("REG_DT").setWidth(24),
new CellDef().setLabel("URL").setField("URL").setWidth(32),
new CellDef().setLabel("설명").setField("DSCRP").setWidth(32),
new CellDef().setLabel("접속일시").setField("REG_DT"),
new CellDef().setLabel("URL").setField("URL"),
new CellDef().setLabel("설명").setField("DSCRP"),
new CellDef().setLabel("파일이름").setField("FILE_NM").setWidth(32),
new CellDef().setLabel("민감정보").setField("PSNL_INFO").setWidth(32)
new CellDef().setLabel("민감정보").setField("PSNL_INFO")
);
XLSWriter xlsx = new XLSWriter()
.worksheet(0)
.trackWidth(CellDef.trackWidth(cellDefs))
.cell(0, 0)
.value("시스템 로그 목록").merge(0, cellDefs.size() - 1)
.cell(2, 0)
@ -117,7 +119,8 @@ public class LoggingController extends AbstractController {
.values(
list,
CellDef.values(cellDefs)
);
)
.autoWidth();
return new ModelAndView("downloadView")
.addObject("download",

Loading…
Cancel
Save