Skip to content

Commit

Permalink
Upgrade to ClosedXML 0.102
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankraty committed Jul 27, 2023
1 parent a530ce9 commit 7200db5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ClosedXML.Report/ClosedXML.Report.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClosedXML" Version="0.101.0" />
<PackageReference Include="ClosedXML" Version="0.102.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="morelinq" Version="3.4.1" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.0" />
Expand Down
16 changes: 8 additions & 8 deletions ClosedXML.Report/Options/PivotTag.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
PivotTable Options Package
================================================
OPTION PARAMS OBJECTS
OPTION PARAMS OBJECTS
================================================
"Pivot" "Name=" Range
"Pivot" "Name=" Range
"Dst="
"RowGrand"
"ColumnGrand"
Expand All @@ -15,10 +15,10 @@ OPTION PARAMS OBJECTS
"AutofitColumns"
"NoSort"
"Data" Column
"Row" Column
"Column" Column
"Page" Column
"Data" Column
"Row" Column
"Column" Column
"Page" Column
================================================
*/

Expand Down Expand Up @@ -200,9 +200,9 @@ private IXLPivotTable CreatePivot(PivotTag pivot, ProcessingContext context, XLP
pt.PreserveCellFormatting = !pivot.HasParameter("NoPreserveFormatting");
pt.ShowGrandTotalsColumns = pivot.HasParameter("ColumnGrand");
pt.ShowGrandTotalsRows = pivot.HasParameter("RowGrand");
pt.SaveSourceData = true;
pt.PivotCache.SaveSourceData = true;
pt.FilterAreaOrder = XLFilterAreaOrder.DownThenOver;
pt.RefreshDataOnOpen = true;
pt.PivotCache.RefreshDataOnOpen = true;
return pt;
}

Expand Down
7 changes: 2 additions & 5 deletions ClosedXML.Report/RangeInterpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,9 @@ string EvalString(string str)
}

// refresh ranges for pivot tables
foreach (var pt in range.Worksheet.Workbook.Worksheets.SelectMany(sh => sh.PivotTables))
foreach (var pivotCache in range.Worksheet.Workbook.PivotCaches)
{
if (pt.SourceRange.Intersects(growedRange))
{
pt.SourceRange = growedRange.Offset(-1, 1, growedRange.RowCount() + 1, growedRange.ColumnCount() - 1);
}
pivotCache.Refresh();
}
}
}
Expand Down

0 comments on commit 7200db5

Please sign in to comment.