NamedRange with LightCellsDataProvider and OoxmlSaveOptions

Hi,


I’am trying to set a named range while using the LightCellsDataProvider Interface.

When nextRow() method would return -1 so no more rows are to handle for the worksheet, I set the named range for this worksheet.

When saving the workbook with XlsSaveOptions everything works fine and the range is successfully created in the xls file.

When saving the workbook with OoxmlSaveOptions the named range is not available in the created xlsx file.

I made some tests and it seems that the “error” only occurs when working with LighCellsDataProvider. I did not find a known bug about this in your ticket system.

Best regards

Hi,


Could you create and post us a sample JAVA program/ example similar to the example code pasted in the document/ article in the docs: http://www.aspose.com/docs/display/cellsjava/Using+LightCells+API , we will check it soon.

Thank you.

I created a sample app based on the code from the article ( http://www.aspose.com/docs/display/cellsjava/Using+LightCells+API).


I made some modifications:

I reduced the number of rows to export to 10.

In LightCellsDataProviderDemo class I added the createNamedRange() method to create the range.

In Demo class I save the result two times ( as xls with XlsSaveOptions and as xlsx with OoxmlSaveOptions). The xls file contains the range while the xlsx file does not.

That is exactly the behaviour of my real application.

Best regards


Hi,


Thanks for the sample project with sample files.

After an initial test, I observed the issue as you mentioned by using your sample project/ code with v8.2.x. When saving the workbook with XlsSaveOptions everything works fine and the range is successfully created in the XLS file, where as when saving the workbook with OoxmlSaveOptions (XLSX file format) the named range is not available in the created XLSX file as you mentioned. I have logged a ticket with an id “CELLSJAVA-41006” 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,

We have evaluated your issue further. Well, NamedRange objects are global for the workbook. They have to be gathered and written together with other global objects before generating data of worksheets when generating XLSX files. With light cells mode, when the LightCellsDataProvider is being called, those global objects have been saved and cannot be changed or newly added. So, please create those objects before saving the workbook (i.e., before the code of calling Workbook.Save()). In short, this is not the issue with Aspose.Cells rather expected behavior due to XLSX file format limitation.

Thank you.