Skip to content

Commit 9380a7d

Browse files
b0bi79jojastahl
andauthored
Fix #133 Formula for table line count placed in wrong line (#160)
* Added test for count tag showing misplaced formula for count (cherry picked from commit f6aef80) * #134 Formula for table line count placed in wrong line Co-authored-by: Jojakim Stahl <jstahl@demig.de>
1 parent b7c0fcc commit 9380a7d

File tree

4 files changed

+2
-1
lines changed

4 files changed

+2
-1
lines changed

ClosedXML.Report/Excel/TempSheetBuffer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private void ChangeAddress(int row, int clmn)
106106
public IXLRange CopyTo(IXLRange range)
107107
{
108108
var firstCell = _sheet.Cell(1, 1);
109-
var lastCell = _sheet.LastCellUsed(XLCellsUsedOptions.All) ?? firstCell;
109+
var lastCell = _sheet.Cell(_prevrow, _prevclmn);
110110
var tempRng = _sheet.Range(firstCell, lastCell);
111111

112112
var rowDiff = tempRng.RowCount() - range.RowCount();

tests/ClosedXML.Report.Tests/GroupTagTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public GroupTagTests(ITestOutputHelper output) : base(output)
2323
InlineData("issue#111_autofilter_with_delete.xlsx"),
2424
InlineData("tLists4_complexRange.xlsx"),
2525
InlineData("tLists5_GlobalVars.xlsx"),
26+
InlineData("tLists6_count.xlsx"),
2627
InlineData("tPage1_options.xlsx"),
2728
]
2829
public void Simple(string templateFile)

tests/Gauges/tLists6_count.xlsx

22.5 KB
Binary file not shown.

tests/Templates/tLists6_count.xlsx

21.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)