Created
October 11, 2011 20:53
-
-
Save ajokela/1279397 to your computer and use it in GitHub Desktop.
Apache POI (Excel in Java) - Span Multiple Columns with Cell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.poi.hssf.usermodel.HSSFCellStyle; | |
import org.apache.poi.hssf.usermodel.HSSFRichTextString; | |
import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
import org.apache.poi.ss.usermodel.Cell; | |
import org.apache.poi.ss.usermodel.Font; | |
import org.apache.poi.ss.usermodel.Row; | |
import org.apache.poi.ss.usermodel.Sheet; | |
import org.apache.poi.ss.usermodel.Workbook; | |
import org.apache.poi.ss.util.CellRangeAddress; | |
HSSFWorkbook wb = new HSSFWorkbook(); | |
Sheet sheet = wb.createSheet(); | |
CellRangeAddress region = new CellRangeAddress( rowIdx, rowIdx, columnIdx, columnIdx+1); | |
sheet.addMergedRegion(region); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment