Is there any other function that can be used to delete rows/ copy rows so that the hyperlink property is copied as well?
Comments: ** Comment from web user: meerashan **
Hi,
I have resolved the issue by making changes to the HSSFSheet ShiftRows() method source code. The issue was that the hyperlink was being set after the row was removed and interchanging this logic fixed the issue
List<ICell> cells = row.Cells;
foreach (ICell cell in cells)
{
NPOI.SS.UserModel.IHyperlink link = cell.Hyperlink;
if (link != null)
{
link.FirstRow = (link.FirstRow + n);
link.LastRow = (link.LastRow + n);
}
row.RemoveCell(cell);
CellValueRecordInterface cellRecord = ((HSSFCell)cell).CellValueRecord;
cellRecord.Row = (rowNum + n);
row2Replace.CreateCellFromRecord(cellRecord);
_sheet.AddValueRecord(rowNum + n, cellRecord);
}