We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

copyRows is not copying sparkline

Dear representative,


I am using Aspose.cells 7.7.1 to copy contents of one excel file to other. While doing the same I noticed copyRows() function is unable to copy sparklines from one sheet to other

Following code snippet can be used to debug:

//Open a template file
Workbook book = new Workbook(“d:\files\sparkline_input1.xlsx”);
Workbook book2 = new Workbook(“d:\files\sparkline_input2.xlsx”);
//Get the first worksheet
Worksheet sheet = book2.getWorksheets().get(0);

Cells cells, sourcecells;

cells = book.getWorksheets().get(0).getCells();
sourcecells = sheet.getCells();

// copy book2’s contents to book’s sheet at the end
cells.copyRows(sourcecells,
0,
cells.getMaxDisplayRange().getRowCount() + 2,
sourcecells.getMaxDisplayRange().getRowCount());

//Save the excel file
book.save(“d:\files\sparkline_output.xlsx”);

I have attached input files for your reference.

I even tried using Aspose.cells 8.2.2.jar as well, issue still persists.

Thanks,
Cpunji

Hi,


Thanks for providing us template files and sample code.

After an initial test, I observed the issue as you mentioned by using your sample code
with your template files. I found Cells.copyRows() method is not copying
sparklines in the XLSX file format.

e.g


Sample code:


//Open a template file
Workbook book = new Workbook("sparkline_input1.xlsx");
Workbook book2 = new Workbook("sparkline_input2.xlsx");

//Get the first worksheet
Worksheet sheet = book2.getWorksheets().get(0);

Cells cells, sourcecells;

cells = book.getWorksheets().get(0).getCells();
sourcecells = sheet.getCells();

// copy book2's contents to book's sheet at the end
cells.copyRows(sourcecells,
0,
cells.getMaxDisplayRange().getRowCount() + 2,
sourcecells.getMaxDisplayRange().getRowCount());

//Save the excel file
book.save("outsparkline_output.xlsx");

I have logged a ticket with an id "CELLSJAVA-41056" for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi Cpunji,

Thanks for using Aspose.Cells.

We have fixed
this issue now. We will provide you a fix in couple of days after
incorporating other enhancements and fixes and conducting some extensive
testing. Once, it is available for you, we will let you know asap by
posting in this thread.

Hi,


Please try our latest fix/version: Aspose.Cells for Java v8.2.2.1

We have fixed your issue now.

Let us know your feedback.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thank you all, It works fine now,


Thanks,
Cpunji

Hi Cpunji,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with the latest version. Let us know if you encounter any other issue, we will be glad to look into it and help you further.