Free Support Forum - aspose.com

Why in excel there is a blank row?

Hi Aspose team,
I need the expert advice here, while creating the list object in excel, there is a blank row coming in between the data rows and total row (excel attached).
How I am creating the list object:
1) First I have created the number of rows (8 rows of data plus one header row) in an work sheet.
2) Get a list object from ‘A1:’ ( using listIObject.add(sourceCell, destCell, true) method)
3) Set show total as true (using listObject.setShowTotals(true))
4) Apply aggregation method on columns, wherever required.
Do you know why in excel there is a blank row?
In here after each step I have logged the end row (using listObject.getEndRow() method) count, and I see the value is 8 after first and second step, but the value become 10 after 3rd step.
P.S. Your Aspose Cell product is described below.
Thanks, &

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells for Java 8.5.0 and see if it resolves your issue.

If your problem still occurs, then please provide us your sample code replicating this issue with the latest version for our investigation. Please also provide us your source excel file and the actual output excel file as well as your expected output excel file.

It seems, you have forgot to attach your excel file as I see no attachment with your post.

Thanks for your cooperation.

pls find attached the sample

Hi Irfan,


Thank you for sharing the sample spreadsheet.

We have evaluated your presented scenario while using the latest version of the Aspose.Cells for Java 8.5.0 and the following piece of code, and we are able to notice the mentioned problem. Please note, the following code creates a ListObject from a range of cells A1:B9. ListObject is being created correctly and the ListObject.getEndRow returns the correct number. When the code enables the ShowTotal for the ListObject, the total is inserted on 11th row of the worksheet where the 10th row becomes the part of the ListObject because ListObject.getEndRow now returns the value with one row added. Moreover, if you check the formula of the total, it also reference the B10 cell that is blank and should not be part of the ListObject.

We have logged this incident in our bug tracking system under the ticket CELLSJAVA-41389 for further investigation into this matter. Please allow us some time to properly analyze this case and get back to you with updates in this regard.

Java

Workbook book = new Workbook(“D:/book1.xlsx”);
Worksheet sheet = book.getWorksheets().get(0);
int index = sheet.getListObjects().add(“A1”, “B9”, true);
ListObject list = sheet.getListObjects().get(index);
System.out.println(list.getEndRow());
list.setShowTotals(true);
System.out.println(list.getEndRow());
book.save(“D:/output.xlsx”, SaveFormat.XLSX);

Hi Irfan,


This is to inform you that we have resolved the problem logged earlier as CELLSJAVA-41389. We will shortly provide the fix here with the next upcoming maintenance release of Aspose.Cells for Java.

Hi,

Thanks for using Aspose.Cells.

Please download and use the latest fix: Aspose.Cells
for Java v8.5.0.2
and let us know your feedback.

To update the Aspose version in our product, I need to know the changes. May I please have a look at the list of changes?

Do we have any solution for adding date in excel using Aspose Cell.

Regards

Hi Irfan,

mediatrendit:

To update the Aspose version in our product, I need to know the changes. May I please have a look at the list of changes?


Please note, the supplied revision of the API is actually a maintenance release therefore we haven't published it in Aspose download section. Moreover, we do not publish the public API changes for such releases so you have to wait for the next official release of Aspose.Cells for Java API to get the details about each and every API changes between 8.5.0 & upcoming 8.5.1. You may also check the Public API Changes section in case you are migrating from any release prior to 8.5.0.

mediatrendit:

Do we have any solution for adding date in excel using Aspose Cell.


You can simply use the Cell.putValue method to insert a date value and set the format afterwards to give it a proper representation. Please check the article on adding data to cells.

Hi Aspose team,

Could you please update on this? Cell.setValue(date) is not working correctly as it is described here (adding data to cells). If it is a bug, please give me the reference BUG ID.

Regards

Hi Irfan,


I have already explained the behavior in detail that while setting a Date object as a cell value you have to style the cell with required format to give it a Date representation in Excel view. In case you still have any ambiguity, please feel free to write back.

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


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