|
@@ -895,11 +895,11 @@ namespace FastReport.Table
|
|
|
float columnsWidth = 0;
|
|
|
for (int i = 0; i < cell.ColSpan; i++)
|
|
|
{
|
|
|
- columnsWidth += Columns[x + i].Width;
|
|
|
+ columnsWidth += Columns[Math.Min(Columns.Count-1,x + i)].Width;
|
|
|
}
|
|
|
|
|
|
// if cell is bigger than sum of column width, increase the last column width
|
|
|
- TableColumn lastColumn = Columns[x + cell.ColSpan - 1];
|
|
|
+ TableColumn lastColumn = Columns[Math.Min(Columns.Count-1,x + cell.ColSpan - 1)];
|
|
|
if (columnsWidth < cellWidth && lastColumn.AutoSize)
|
|
|
lastColumn.Width += cellWidth - columnsWidth;
|
|
|
}
|