Hi,
I have to apply Underline (typically Font Style) over a range [startRow, startCol, endRow, endCol]. Is there any way other than the cell by cell operations for which I can apply it over the range?
Attached is the current code that is being used for applying underline…
private void Underline(Aspose.Cells.Workbook workBook, int startRow, int startColumn, int endRow, int endColumn, string sheetName, FontUnderlineType underLine)
{
startRow–;
endRow–;
startColumn–;
endColumn–;
if (endRow < startRow || endColumn < startColumn)
return;
if (string.IsNullOrEmpty(sheetName))
sheetName = workBook.Worksheets[workBook.Worksheets.ActiveSheetIndex].Name;
for (int rowIndex = startRow; rowIndex <= endRow; rowIndex++)
{
for (int colIndex = startColumn; colIndex <= endColumn; colIndex++)
{
Aspose.Cells.Style style = workBook.Worksheets[sheetName].Cells[rowIndex, colIndex].GetStyle();
style.Font.Underline = underLine;
workBook.Worksheets[sheetName].Cells[rowIndex, colIndex].SetStyle(style);
}
}
}
Thanks & Regards,.
Anil