Free Support Forum - aspose.com

Empty CSV columns with LightCellsDataProvider

Hello,

Aspose Cells produces empty trailing columns in CSV when using LightCellsDataProvider.

This bug has been introduced in version 20.4 and it still present in version 20.10.

Code used (LightCellsDataProviderDemo.java):

Workbook wb = new Workbook();
TxtSaveOptions options = new TxtSaveOptions(SaveFormat.CSV);
options.setLightCellsDataProvider(new LightCellsDataProviderDemo(wb, 1, 3, 3));
wb.save("test.csv", options);

Result:

        ,test_0_1,test_0_2,,,,,,,,...
test_1_0,test_1_1,test_1_2,,,,,,,,...
test_2_0,test_2_1,test_2_2,,,,,,,,...

Best Regards

@flammang,

As you are rendering to CSV file format, so could you paste/attach complete sample (runnable) code (Java demo (class) and Interface that implements “LightCellsDataProvider”), we will check it soon.

Also, was it working differently? Please also share the output file by some older version (as per your expectations).

Hi,

Result from version 20.3 and before:

        ,test_0_1,test_0_2
test_1_0,test_1_1,test_1_2
test_2_0,test_2_1,test_2_2

I used your example implementation from Github:

@flammang,

Could you also paste code for the main class where you implements light cells data provider and save to CSV file format, we will check it soon.

LightCellsDataProviderDemo.zip (1.3 KB)

@flammang,

I tried your exact code (using both latest fix and older version) and got “NullPointerException” when saving to CSV file. If I use OoxmlSaveOptions to save to XLSX file, it works fine. So, there is something not supported when saving to CSV file format. See the screenshot for your reference:
sc_shot1.png (55.2 KB)

Does it work fine on your end. I am using latest version/fix: Aspose.Cells for Java v20.10.8. I also tried some older fix (Aspose.Cells for Java v20.2.x) and got the same exception.

Well, you have to setup your license correctly first.
see here:

@flammang,

Please notice, after setting the license, I am able to reproduce the issue as you have mentioned. Aspose.Cells produces empty trailing columns of (commas) in CSV when using LightCellsDataProvider, It works fine (pointed out) with older version (e.g Aspose.Cells for Java v20.2.x) though as I tested. I have logged a ticket with an id “CELLSJAVA-43341”.

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

@flammang,
This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

1 Like

@flammang,

Please try our latest version/fix: Aspose.Cells for Java v20.11.2 (attached)
aspose-cells-20.11.2.zip (7.0 MB)

Your issue should be fixed in it.

Let us know your feedback.