# Show GN: kotlin-excel-dsl - Kotlin DSL로 엑셀 파일을 타입 세이프하게 생성하기

> Clean Markdown view of GeekNews topic #25955. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=25955](https://news.hada.io/topic?id=25955)
- GeekNews Markdown: [https://news.hada.io/topic/25955.md](https://news.hada.io/topic/25955.md)
- Type: show
- Author: [abcdkh1209](https://news.hada.io/@abcdkh1209)
- Published: 2026-01-19T12:52:19+09:00
- Updated: 2026-01-19T12:52:19+09:00
- Original source: [github.com/clroot](https://github.com/clroot/kotlin-excel-dsl)
- Points: 4
- Comments: 1

## Topic Body

Kotlin에서 엑셀 파일을 만들 때마다 Apache POI의 장황한 코드가 불편했습니다. 셀 하나 만들려면 Workbook → Sheet → Row → Cell을 거쳐야 하고, 스타일 적용은 더 복잡하죠.  
  
그래서 Kotlin DSL로 엑셀 생성을 단순화하는 라이브러리를 만들었습니다.  
  
**GitHub:** https://github.com/clroot/kotlin-excel-dsl  
  
##### 특징  
  
- **DSL + 어노테이션 하이브리드**: 복잡한 경우엔 DSL, 단순한 경우엔 `@Excel`, `@Column` 어노테이션  
- **타입 세이프**: 컴파일 타임에 설정 오류 검증  
- **CSS 스타일 문법**: 직관적인 스타일 정의  
- **기본 테마 제공**: Modern, Minimal, Classic  
- **헤더 그룹**: 다중 행 헤더와 자동 셀 병합  
  
##### 사용 예시  
  
```kotlin  
// DSL 방식  
excel {  
    sheet&lt;User&gt;("Users") {  
        column("이름") { it.name }  
        column("나이") { it.age }  
        column("가입일") { it.joinedAt }  
        rows(users)  
    }  
}.writeTo(FileOutputStream("users.xlsx"))  
  
// 어노테이션 방식  
@Excel  
data class User(  
    @Column("이름") val name: String,  
    @Column("나이") val age: Int  
)  
excelOf(users).writeTo(output)  
```  
  
##### 스타일 적용  
  
```kotlin  
excel {  
    styles {  
        header { bold(); backgroundColor(Color.GRAY) }  
        column("금액") {  
            body { align(Alignment.RIGHT); numberFormat("#,##0") }  
        }  
    }  
    // ...  
}  
```  
  
##### 설치  
  
```kotlin  
implementation("io.clroot.excel:excel-dsl:0.1.0")  
```  
  
Kotlin 2.2.0+, JDK 21+ 환경에서 사용 가능합니다. 피드백 환영합니다!

## Comments



### Comment 49728

- Author: hshim
- Created: 2026-01-23T09:36:30+09:00
- Points: 1

개인적으로 있었음 했던 라이브러리라 유용하게 쓸 것 같습니다! 개인적으로 excel 기반 라이브러리긴 하지만 csv나 pdf export 기능도 들어가면 어떨까 싶네요
