You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing-toc.html
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6368,6 +6368,9 @@
6368
6368
<li>
6369
6369
<a href="/document-processing/excel/excel-library/net/faqs/how-to-retrieve-the-list-of-named-ranges-in-an-Excel-workbook">How to retrieve the list of named ranges in an Excel workbook?</a>
6370
6370
</li>
6371
+
<li>
6372
+
<a href="/document-processing/excel/excel-library/net/faqs/how-to-identify-the-end-column-of-a-pivottable-in-excel">How to identify the end column of a PivotTable in Excel?</a>
6373
+
</li>
6371
6374
<li>
6372
6375
<a href="/document-processing/excel/excel-library/net/faqs/how-to-extract-embedded-OLE-files-from-an-Excel-workbook-as-streams">How to extract embedded OLE files from an Excel workbook as streams?</a>
Copy file name to clipboardExpand all lines: Document-Processing/Excel/Excel-Library/NET/Pivot-Table/Pivot-Table-Options.md
+1-78Lines changed: 1 addition & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -334,81 +334,4 @@ End Using
334
334
{% endhighlight %}
335
335
{% endtabs %}
336
336
337
-
A complete working example to add calculated field in pivot table in C# is present on [this GitHub page](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Pivot%20Table/Calculated%20Field/.NET/Calculated%20Field).
338
-
339
-
### Get PivotTable end column
340
-
341
-
To obtain a PivotTable's end column, call PivotTable.Layout(), then read the EndLocation property from the implementation type. The EndLocation range's LastColumn value is the pivot table's last column index.
Dim application As IApplication = excelEngine.Excel
395
-
application.DefaultVersion = ExcelVersion.Xlsx
396
-
397
-
' Open workbook (update path as needed)
398
-
Dim workbook As IWorkbook = application.Workbooks.Open("PivotTable.xlsx")
399
-
400
-
Dim pivotTable As IPivotTable = workbook.Worksheets(0).PivotTables(0)
401
-
402
-
' Calculate layout
403
-
pivotTable.Layout()
404
-
405
-
' Read EndLocation from implementation and get last column
406
-
Dim endRange As IRange = DirectCast(pivotTable, Syncfusion.XlsIO.Implementation.PivotTables.PivotTableImpl).EndLocation
407
-
Dim lastColumn As Integer = endRange.LastColumn
408
-
409
-
Console.WriteLine("PivotTable last column: " & lastColumn)
410
-
End Using
411
-
{% endhighlight %}
412
-
{% endtabs %}
413
-
414
-
A complete working example to get the end column of a pivot table in C# is present on [this GitHub page](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Pivot%20Table/End%20Column/.NET/End%20Column).
337
+
A complete working example to add calculated field in pivot table in C# is present on [this GitHub page](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Pivot%20Table/Calculated%20Field/.NET/Calculated%20Field).
title: Identify the end column of a PivotTable in Excel | Syncfusion
3
+
description: Code example to identify the end column of a PivotTable in an Excel workbook using the Syncfusion .NET Excel library (XlsIO).
4
+
platform: document-processing
5
+
control: XlsIO
6
+
documentation: UG
7
+
---
8
+
9
+
# How to identify the end column of a PivotTable in Excel?
10
+
11
+
The following code examples demonstrate how to identify the end column of a PivotTable in an Excel workbook using C# (Cross-platform and Windows-specific) and VB.NET.
Dim application As IApplication = excelEngine.Excel
65
+
application.DefaultVersion = ExcelVersion.Xlsx
66
+
67
+
' Open workbook (update path as needed)
68
+
Dim workbook As IWorkbook = application.Workbooks.Open("PivotTable.xlsx")
69
+
70
+
Dim pivotTable As IPivotTable = workbook.Worksheets(0).PivotTables(0)
71
+
72
+
' Calculate layout
73
+
pivotTable.Layout()
74
+
75
+
' Read EndLocation from implementation and get last column
76
+
Dim endRange As IRange = DirectCast(pivotTable, Syncfusion.XlsIO.Implementation.PivotTables.PivotTableImpl).EndLocation
77
+
Dim lastColumn As Integer = endRange.LastColumn
78
+
79
+
Console.WriteLine("PivotTable last column: " & lastColumn)
80
+
End Using
81
+
{% endhighlight %}
82
+
{% endtabs %}
83
+
84
+
A complete working example to identify the end column of a pivot table in C# is present on [this GitHub page](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/FAQ/Pivot%20Tables%20End%20Column/.NET/End%20Column).
0 commit comments