티스토리 뷰
var workbook = new HSSFWorkbook();
var sheet1 = workbook.CreateSheet("Monthly Delivery Statistic");
sheet1.SetColumnWidth(0, 7000);
sheet1.SetColumnWidth(1, 7000);
sheet1.SetColumnWidth(2, 7000);
sheet1.SetColumnWidth(3, 7000);
sheet1.SetColumnWidth(4, 7000);
#region 헤더 정의 및 스타일 적용
IFont boldFont = workbook.CreateFont();
boldFont.IsBold = true;
ICell sheet1HearderCell = null;
ICellStyle headerStyle = workbook.CreateCellStyle();
headerStyle.Alignment = HorizontalAlignment.Center;
headerStyle.VerticalAlignment = VerticalAlignment.Center;
headerStyle.WrapText = true;
headerStyle.SetFont(boldFont);
ICellStyle headerBorderBottomStyle = workbook.CreateCellStyle();
headerBorderBottomStyle.Alignment = HorizontalAlignment.Center;
headerBorderBottomStyle.VerticalAlignment = VerticalAlignment.Center;
headerBorderBottomStyle.WrapText = true;
headerBorderBottomStyle.SetFont(boldFont);
headerBorderBottomStyle.BorderBottom = BorderStyle.Thick;
IRow sheet1HeaderRow = sheet1.CreateRow(0);
sheet1HeaderRow.Height = 500;
sheet1HearderCell = sheet1HeaderRow.CreateCell(0);
sheet1HearderCell.CellStyle = headerStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString("Registration date"));
sheet1HearderCell = sheet1HeaderRow.CreateCell(1);
sheet1HearderCell.CellStyle = headerStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString("Number of registrations"));
sheet1HearderCell = sheet1HeaderRow.CreateCell(3);
sheet1HearderCell.CellStyle = headerStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString("Number of Qxpress shipped"));
IRow sheet1HeaderRow2 = sheet1.CreateRow(1);
sheet1HeaderRow2.Height = 500;
sheet1HearderCell = sheet1HeaderRow2.CreateCell(0);
sheet1HearderCell.CellStyle = headerBorderBottomStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString(""));
sheet1HearderCell = sheet1HeaderRow2.CreateCell(1);
sheet1HearderCell.CellStyle = headerBorderBottomStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString("QFS"));
sheet1HearderCell = sheet1HeaderRow2.CreateCell(2);
sheet1HearderCell.CellStyle = headerBorderBottomStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString("Smart"));
sheet1HearderCell = sheet1HeaderRow2.CreateCell(3);
sheet1HearderCell.CellStyle = headerBorderBottomStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString("QFS"));
sheet1HearderCell = sheet1HeaderRow2.CreateCell(4);
sheet1HearderCell.CellStyle = headerBorderBottomStyle;
sheet1HearderCell.SetCellValue(new HSSFRichTextString("Smart"));
sheet1.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(0, 0, 1, 2));
sheet1.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(0, 0, 3, 4));
sheet1.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(0, 1, 0, 0));
#endregion
int sheet1RowIndex = 1;
IRow sheet1ColumnRow = null;
for (int i = 0; i < 2; i++)
{
sheet1RowIndex += 1;
sheet1ColumnRow = sheet1.CreateRow(sheet1RowIndex);
sheet1ColumnRow.Height = 400;
sheet1ColumnRow.CreateCell(0).SetCellValue("0");
sheet1ColumnRow.CreateCell(1).SetCellValue("1");
sheet1ColumnRow.CreateCell(2).SetCellValue("2");
sheet1ColumnRow.CreateCell(3).SetCellValue("3");
sheet1ColumnRow.CreateCell(4).SetCellValue("4");
}
using (var memoryStream = new MemoryStream())
{
workbook.Write(memoryStream);
byte[] bytes = memoryStream.ToArray();
if (bytes.Length > 0)
{
return File(bytes, "application/vnd.ms-excel", "Monthly Delivery Statistic.xls");
}
}
- Total
- Today
- Yesterday
- java web-mvc
- 스프링 프레임워크(spring framework)
- React
- 문자 자르기
- 메이븐(maven)
- java.sql
- java 키워드 정리
- 특정 문자를 기준으로 자르기
- .submit()
- 상품 등록
- System.Diagnostics
- error-java
- 스프링 시큐리티(spring security)-http basic 인증
- In App Purchase
- 인텔리제이(intellij)
- MainActor
- 람다식(lambda expression)
- jstl(java standard tag library)-core
- 스프링 프레임워크(spring framewordk)
- jsp 오픈 소스
- REST API
- 스프링 시큐리티(spring security)
- jstl(java standard tag library)
- system.io
- 진수 변환
- nl2br
- 표현 언어(expression language)
- 제품 등록
- java-개발 환경 설정하기
- await
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 28 | 29 | 30 | 31 |