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

Free Support Forum - aspose.com

Unable to add data to newly created sheet

Hi Team,


I have a requirement to add a new sheet to the existing workbook which already contains one sheets.

Creating new sheet code which i added
-----------------------------------------------
int sheetIndex = worksheets.add();
Worksheet writeWorkSheet = (Worksheet)worksheets.get(sheetIndex);
writeWorkSheet.setName(“Sub Totals”);

After this i’m calling the LightCellsDataProvider.

I’m able to add the second sheet, but whenever I call LightCellsDataProvider, it inserts data to first sheet instead of second sheet. Please let me know what am i doing wrong here.

Thanks,
Sukesh

Hi Sukesh,


Thank you for contacting Aspose support.

It seems that the problem could be with your own logic (how you have implemented the Aspose.Cells APIs in your application). We will be in a better position to assist you with it if you can provide us an executable (with no compilation errors) sample application to replicate the said behaviour on our side. Please also provide the environment details as follow so we could also simulate it on our side.

  • Operating system version & architecture
  • JDK vendor, version & architecture
  • JVM arguments, if any
  • Input spreadsheet, if any

Hi Babar,


Thanks for the reply. We have changed the code to suit our requirement(That fixed our issue!). We are no longer using LightCellsDataProvider.

Thanks,
Sukesh

Hi Sukesh,


It is good to know that you are able to resolve the problem. Please feel free to contact us back in case you need our assistance with Aspose APIs.