Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ public bool IsHidden(int rowOffset, int colOffset)
/// <returns>The adjusted address.</returns>
public FormulaRangeAddress GetAddressDimensionAdjusted(int index)
{
return _address;
var dimension = _externalWs?.GetDimension()?.AsFormulaRangeAddress(_address._context);
return dimension ?? _address;
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/EPPlusTest/Drawing/Chart/ChartSeriesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public void AddColumnChartSingleSerieWithSecondSerieWithCategoryWithLinear()
//which causes System.ArgumentException: Negative percentage not allowed
var serie1 = chart.Series.Add(ws.Cells["D2"]);
var serie2 = chart.Series.Add(ws.Cells["D2"], ws.Cells["C2"]);

chart.StyleManager.ColorsManager.Method = OfficeOpenXml.Drawing.Chart.Style.eChartColorStyleMethod.Cycle;
}

[TestMethod]
Expand Down
23 changes: 20 additions & 3 deletions src/EPPlusTest/Issues/FormulaCalculationIssues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ public void s965_3()
using var package = OpenTemplatePackage("s965-Not Calculated.xlsx");
//package.Workbook.Calculate();
var ws = package.Workbook.Worksheets["Calculation"];
package.Workbook.Calculate();
package.Workbook.Calculate();
Assert.AreEqual("72201004296", ws.Cells["J2"].Value);
Assert.AreEqual("72201024296", ws.Cells["J4"].Value);
Assert.IsNull(ws.Cells["J5"].Value);
Expand Down Expand Up @@ -1537,7 +1537,7 @@ public void s1029()
wb.FullCalcOnLoad = false;
wb.CalcMode = ExcelCalcMode.Manual;
ws.Cells["Q2"].Calculate();
Assert.AreEqual("365" ,ws.Cells["Q2"].Value);
Assert.AreEqual("365", ws.Cells["Q2"].Value);
Assert.AreEqual("181-365", ws.Cells["Q45"].Value);
Assert.AreEqual("90", ws.Cells["Q55"].Value);
Assert.AreEqual(6D, ws.Cells["A34"].Value);
Expand Down Expand Up @@ -1646,7 +1646,24 @@ public void s1048()
Assert.AreEqual(702D, wsSummary.Cells["C57"].Value);
Assert.AreEqual("Yes!", wsSummary.Cells["E57"].Value);

SaveWorkbook("S1048-calculated.xlsx",p);
SaveWorkbook("S1048-calculated.xlsx", p);
}
}
[TestMethod]
public void s1050()
{
using (var p = OpenTemplatePackage("issues\\s1050\\Data File.xlsx"))
{
var ws = p.Workbook.Worksheets["Sheet1"];
ws.Cells["E2:E2164"].Formula = "VLOOKUP(D2,'[1]LIST'!C:C,1,0)"; //1 is the Linked File position
ws.Calculate();

ws.Cells["E1:E2164"].CopyValues(ws.Cells["AU1"]);
Assert.AreEqual(ws.Cells["E172"].Value, 27823D);
Assert.AreEqual(ws.Cells["E2113"].Value, 15064D);
Assert.AreEqual(ws.Cells["AU172"].Value, 27823D);
Assert.AreEqual(ws.Cells["AU2113"].Value, 15064D);
SaveWorkbook("s1050-saved.xlsx", p);
}
}
}
Expand Down
Loading