}
}
private void fillCell(int iRow, int iCol,
AutoFillDlg autoFill, Element savedStream, Style style) throws ReportException {
TableCell iCell = model.getValueAt(new CellPosition(iRow, iCol));
if (iCell instanceof SheetCell) {
SheetCell sc = (SheetCell) iCell;
if (autoFill.isCopyValue() && savedStream != null) {
sc.getCellFormat().restoreState(savedStream);
}
}
if (style == null) {
return;
}
Style newStyle = iCell.getStyle();
if (autoFill.isCopyStyle() && newStyle == null) {
newStyle = new StyleDefault();
}
if (autoFill.isCopyColor()) {
newStyle.setForeground(style.getForeground());
newStyle.setBackground(style.getBackground());
}
if (autoFill.isCopyFont()) {
newStyle.setFont(style.getFont());
}
if (autoFill.isCopyMargin()) {
newStyle.setMargin(style.getMargin());
}
if (autoFill.isCopyBorder()) {
newStyle.setBorder(style.getBorder());
}
if (autoFill.isCopyAlign()) {
newStyle.setTextAlign(style.getTextAlign());
newStyle.setTextVAlign(style.getTextVAlign());
}
iCell.setStyle(newStyle);
}