merge(...) 추가

master
mjkhan21 11 months ago
parent 92cbb0f8b3
commit d107833350

@ -15,6 +15,7 @@ import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFCell;
import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFRow;
import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFSheet;
@ -156,6 +157,28 @@ public class XLSWriter extends XLS {
return row(row).col(col); return row(row).col(col);
} }
/** .
* @param firstRow
* @param lastRow
* @param firstCol
* @param lastCol
* @return XLSWriter
*/
public XLSWriter merge(int firstRow, int lastRow, int firstCol, int lastCol) {
worksheet.addMergedRegion(new CellRangeAddress(firstRow, lastRow, firstCol, lastCol));
return this;
}
/** .
* @param firstCol
* @param lastCol
* @return XLSWriter
*/
public XLSWriter merge(int firstCol, int lastCol) {
int index = row.getRowNum();
return merge(index, index, firstCol, lastCol);
}
/** . /** .
* @param val * @param val
* @param style (CellStyle, Styler, KeyStyle) * @param style (CellStyle, Styler, KeyStyle)

Loading…
Cancel
Save