Skip to content
Open
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
25 changes: 25 additions & 0 deletions FAQ/Pivot Tables End Column/.NET/End Column/End Column.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31729.503
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "End Column", "End Column\End Column.csproj", "{BF68636F-D6AA-49C5-B2AC-858E2B608FD4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BF68636F-D6AA-49C5-B2AC-858E2B608FD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF68636F-D6AA-49C5-B2AC-858E2B608FD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF68636F-D6AA-49C5-B2AC-858E2B608FD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF68636F-D6AA-49C5-B2AC-858E2B608FD4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8443B870-FDE6-49F8-B015-37C3611835D0}
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Calculated_Field</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.XlsIO.NET" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>



Empty file.
36 changes: 36 additions & 0 deletions FAQ/Pivot Tables End Column/.NET/End Column/End Column/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Syncfusion.XlsIO;
using System;
using System.IO;

namespace End_Column
{
class Program
{
static void Main(string[] args)
{
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;
IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"));
IWorksheet sheet = workbook.Worksheets[1];
IPivotTable pivotTable = sheet.PivotTables[0];

// Ensure layout is calculated
pivotTable.Layout();

// Read EndLocation from the implementation type
IRange endRange = (pivotTable as Syncfusion.XlsIO.Implementation.PivotTables.PivotTableImpl).EndLocation;
int lastColumn = endRange.LastColumn;

// Use lastColumn as needed (e.g., log)
Console.WriteLine("PivotTable last column: " + lastColumn);
}
}
}
}