Hi everybody,
I have this strange problem when I call method splitByRowSpan(int arg0); I got an exception:
class com.aspose.slides.b.a.g: Specified argument was out of the range of valid values.
Parameter name: Index must be grater than 0 and less than RowSpan.
com.aspose.slides.CellEx.splitByRowSpan(Unknown Source) …
although the parameter arg0 has correct value. This is the code I used for testing:
final PresentationEx pres = new PresentationEx();
final SlideEx sld = pres.getSlides().get_Item(0);
final double[] dblCols = { 50, 50, 50 };
final double[] dblRows = { 50, 30, 30, 30, 30 };
final int idx = sld.getShapes().addTable(100, 50, dblCols, dblRows);
final TableEx table = (TableEx) sld.getShapes().get_Item(idx);
table.mergeCells(table.get_Item(0, 0), table.get_Item(0, 1), true);
table.mergeCells(table.get_Item(0, 1), table.get_Item(0, 2), true);
final CellEx cell = table.get_Item(0, 0);
final int rowSpan = cell.getRowSpan();
if (rowSpan > 1)
{
cell.splitByRowSpan(rowSpan - 1);
}
The thing is that if I use splitRowByColSpan it works, this is the code for colSpan:
final PresentationEx pres = new PresentationEx();
final SlideEx sld = pres.getSlides().get_Item(0);
final double[] dblCols = { 50, 50, 50 };
final double[] dblRows = { 50, 30, 30, 30, 30 };
final int idx = sld.getShapes().addTable(100, 50, dblCols, dblRows);
final TableEx table = (TableEx) sld.getShapes().get_Item(idx);
table.mergeCells(table.get_Item(0, 0), table.get_Item(1, 0), true);
table.mergeCells(table.get_Item(1, 0), table.get_Item(2, 0), true);
final CellEx cell = table.get_Item(0, 0);
final int colSpan = cell.getColSpan();
if (colSpan > 1)
{
cell.splitByColSpan(colSpan - 1);
}