References are not updated when expanding a range

=======================================
>>> Aspose version : 7.2.0.0
---------------------------------------

COLUMN EXPAND
Before insertRangeShiftToRight
='Production Calculation'!A13:B14
After insertRangeShiftToRight
='Production Calculation'!A13:B14 Which should match: ='Production Calculation'!C13:D14


ROW EXPAND
Before insertRangeShiftDown
='Production Calculation'!A22:B23
After insertRangeShiftDown
='Production Calculation'!A22:B23 Which should match: ='Production Calculation'!A24:B25

Hi,


Thanks for providing us the template file and code segment.

I can find the issue as you have mentioned. Even I tried to use another overloads: e.g
insertRange(CellArea area, int shiftNumber, int shiftType, boolean updateReference) with last parameter true

Sample code:

System.out.println("=======================================");
System.out.println(">>> Aspose version : " + CellsHelper.getVersion());
System.out.println("---------------------------------------");

License lic = new License();
lic.setLicense(new FileInputStream(“lib/Aspose.Cells.lic”));

String fileName = “RangeExpandTemplate1.xls”;

Workbook workbook = new Workbook(fileName);

// COLUMN EXPAND
Cells cells = workbook.getWorksheets().get(“Production Calculation”).getCells();
Cells startSheet = workbook.getWorksheets().get(“EC”).getCells();
System.out.println("\nCOLUMN EXPAND");
System.out.println(“Before insertRangeShiftToRight”);
System.out.println(startSheet.get(18,2).getFormula());
int row = 12;
CellArea colArea = CellArea.createCellArea(row, 0, row+1, 1);
cells.insertRange(colArea, 2, ShiftType.RIGHT, true);

System.out.println(“After insertRangeShiftToRight”);
System.out.println(startSheet.get(18,2).getFormula() +" Which should match: =‘Production Calculation’!C13:D14");

// ROW EXPAND
System.out.println("\n\nROW EXPAND");
System.out.println(“Before insertRangeShiftDown”);
System.out.println(startSheet.get(19,2).getFormula());
row = 21;
CellArea rowArea = CellArea.createCellArea(row, 0, row+1, 1);
cells.insertRange(rowArea, 2, ShiftType.DOWN, true);


System.out.println(“After insertRangeShiftDown”);
System.out.println(startSheet.get(19,2).getFormula() + " Which should match: =‘Production Calculation’!A24:B25");

I have logged a ticket with an id: CELLSJAVA-40186. We will look into it soon.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-40186) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

I do not find the issue fixed:

=======================================

Aspose version : 7.2.1.0



Before insertRangeShiftToRight

C19 : =‘Production Calculation’!A13:B14

After insertRangeShiftToRight

C19 : =‘Production Calculation’!A13:B14

Hi,

I have tested your code and found, everything is working fine with the latest version:

Aspose.Cells for Java 7.2.1



Please see the output of the code. It is correct.

Output:

=======================================
>>> Aspose version : 7.2.1.0
---------------------------------------

COLUMN EXPAND
Before insertRangeShiftToRight
=‘Production Calculation’!A13:B14
After insertRangeShiftToRight
=‘Production Calculation’!C13:D14 Which should match: =‘Production Calculation’!C13:D14


ROW EXPAND
Before insertRangeShiftDown
=‘Production Calculation’!A22:B23
After insertRangeShiftDown
=‘Production Calculation’!A24:B25 Which should match: =‘Production Calculation’!A24:B25
Done

It works fine, thanks

Hi,

It’s good to know that your issue is resolved now.

Let us know if you encounter any problem, we will help you asap.