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

Free Support Forum - aspose.com

ListObject.ShowTotals inserts empty row

Hi,

when using listobjects, setting ShowTotals = true cause the listobject/table to be expanded with one empty row at the bottom (between the last datarow and the totals row.

Se the following code:

var listObject = ws.ListObjects[ws.ListObjects.Add(topRow, leftCol, topRow + items.Count(), leftCol + columnCount, true)];

listObject.TableStyleType = Aspose.Cells.Tables.TableStyleType.TableStyleMedium2;

// Here, the “file” is ok, the rows are ok.

listObject.ShowTotals = true;

// here, not one but two rows are added, the totals row and an empty row above it

==> how to fix this?

Hi,


The ListObject/Tables feature provided by Aspose.Cells works the same way MS Excel does, if you find any difference comparing with MS Excel when you manually do your task, please share the template file (by manually created in MS Excel) and the output file(by Aspose.Cells APIs) with runnable sample code to show the issue. Also, if you have input file, also attach it here. We will check it soon.

By the way, you may try to use Cells.DeleteRow() method to remove the extra empty row (if it has) for your needs.

Thank you.

I had the same problem. I set ShowTotals on false, resized ListObject/Table, inserted data, saved workbook, opened workbook and set ShowTotals on true and saved workbook. Aspose inserted one empty row. I attach excel files which show the problem.

Hi juzek,


Could you provide us sample code (runnable) that you are using to re-size the ListObject/ table and insert data, we will check it soon.

Thank you.

http://www.wklej.org/id/1424916/
http://www.wklej.org/id/1424910/ - I delete here empty row and it works.
http://www.wklej.org/id/1424915/

Hi,


Thanks for the code segments.

It looks like Aspose.Cells does insert an extra empty row when manipulating ListObjects/ tables, so one can remove the extra row accordingly. We appreciate if you could provide us a stand alone application (runnable), it will help us to evaluate your issue quickly, so we can log a ticket into our database to consequently figure it out soon.

Thank you.