As far as I know, LightCellsDataHandler does not read the empty cells i.e. processCell() does not get called for empty cells. But, for the excel: empty multiple columns and rows.xls, it gives empty cells.
For another sheet: 97-2003.xls, it does not read empty cells.
Kindly let us know the exact behaviour for which cells are read by
LightCellsDataHandler.
Hi,
Attached the code in Handler.zip which reads excel file using LightCellsDataHandler.
While reading mini.xls, it reads empty cells specifically column H, column K, and rows 3,4,5,16.
The program prints string “EMPTY THIS IS” when the empty cell is encountered.
In another workbook 97-2003.xls, there is empty column B, and empty row 4, but it is not read by the LightCellsDataHandler.
Let us know how it’s working differently in both the cases.
Hi,
Thanks, it works.
But, empty cells starting with single quote(’) are still appearing. Is there any way to get rid of such cells?
Kindly check the file attached.
With the code provided earlier, it loads the file (with empty cells) properly with LightCellsDataHandler.
If the loadDataOptions is set as follows, the file does NOT open. No stacktrace in console. Just says, “program terminated” as shown in the screenshot.
loadOptions.setLoadDataFilterOptions(LoadDataFilterOptions.ALL & ~LoadDataFilterOptions.CELL_BLANK);
Any udpates?
Thanks.
Request you to update the documentation page Using LightCells API|Documentation with the information/outcome of the following two threads:
Sample statements for updating help:
- LightCells API does NOT read empty cells, but some empty cells like you mentioned are read.
- We can avoid loading of blank cell values as you mentioned earlier.
Also why LoadDataFilterOptions.CELL_BLANK is failing with the file SuperEatsBasics.xlsx?
I have aspose cells for java 9.0.0.
There is no class named LoadFilter. So the code provided by you is:
LoadFilter lf = new LoadFilter();
lf.setLoadDataFilterOptions(LoadDataFilterOptions.ALL & ~LoadDataFilterOptions.CELL_BLANK);
Code for the version 9.0.0 would be:
LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadDataFilterOptions(LoadDataFilterOptions.ALL & ~LoadDataFilterOptions.CELL_BLANK);
NonEmptyCellsHandler nech = new NonEmptyCellsHandler();
loadOptions.setLightCellsDataHandler((LightCellsDataHandler) nech);
new Workbook(“Basics.xlsx”, loadOptions);
It does not work with the excel provided earlier. Using the program mentioend above, it does not read any data. Kindly check with version 9.0.0 and let us know the work-around if any.
Hi,
Yep, the version 17.1.0 is working fine as expected.