File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ Microsoft Visual Studio Solution File, Format Version 12.00
3+ # Visual Studio Version 17
4+ VisualStudioVersion = 17.9.34310.174
5+ MinimumVisualStudioVersion = 10.0.40219.1
6+ Project ("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" ) = "FreezePivotTableHeader" , "FreezePivotTableHeader\FreezePivotTableHeader.csproj" , "{6A87150C-3AB9-4F73-943D-880A5091DBCD}"
7+ EndProject
8+ Global
9+ GlobalSection (SolutionConfigurationPlatforms ) = preSolution
10+ Debug| Any CPU = Debug| Any CPU
11+ Release| Any CPU = Release| Any CPU
12+ EndGlobalSection
13+ GlobalSection (ProjectConfigurationPlatforms ) = postSolution
14+ {6A87150C-3AB9-4F73-943D-880A5091DBCD} .Debug| Any CPU .ActiveCfg = Debug| Any CPU
15+ {6A87150C-3AB9-4F73-943D-880A5091DBCD} .Debug| Any CPU .Build .0 = Debug| Any CPU
16+ {6A87150C-3AB9-4F73-943D-880A5091DBCD} .Release| Any CPU .ActiveCfg = Release| Any CPU
17+ {6A87150C-3AB9-4F73-943D-880A5091DBCD} .Release| Any CPU .Build .0 = Release| Any CPU
18+ EndGlobalSection
19+ GlobalSection (SolutionProperties ) = preSolution
20+ HideSolutionNode = FALSE
21+ EndGlobalSection
22+ GlobalSection (ExtensibilityGlobals ) = postSolution
23+ SolutionGuid = {5438F081-8D9A-4D05-8234-C220E1FE4339}
24+ EndGlobalSection
25+ EndGlobal
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+
3+ <PropertyGroup >
4+ <OutputType >Exe</OutputType >
5+ <TargetFramework >net8.0</TargetFramework >
6+ <RootNamespace >Edit_Pivot_Table</RootNamespace >
7+ <ImplicitUsings >enable</ImplicitUsings >
8+ <Nullable >enable</Nullable >
9+ </PropertyGroup >
10+
11+ <ItemGroup >
12+ <PackageReference Include =" Syncfusion.XlsIO.Net.Core" Version =" *" />
13+ </ItemGroup >
14+
15+ <ItemGroup >
16+ <None Update =" Data\*" >
17+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
18+ </None >
19+ <None Update =" Output\*" >
20+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
21+ </None >
22+ </ItemGroup >
23+
24+ </Project >
25+
26+
27+
Original file line number Diff line number Diff line change 1+ using System . IO ;
2+ using Syncfusion . XlsIO ;
3+ using Syncfusion . XlsIO . Implementation . PivotTables ;
4+
5+ namespace Edit_Pivot_Table
6+ {
7+ class Program
8+ {
9+ static void Main ( string [ ] args )
10+ {
11+ using ( ExcelEngine excelEngine = new ExcelEngine ( ) )
12+ {
13+ IApplication application = excelEngine . Excel ;
14+ application . DefaultVersion = ExcelVersion . Xlsx ;
15+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) ) ;
16+
17+ //Freeze row and column
18+ IWorksheet freezeSheet = workbook . Worksheets [ 1 ] ;
19+ IRange range = freezeSheet . PivotTables [ 0 ] . Location ;
20+ freezeSheet [ range . Row + 1 , range . Column + 1 ] . FreezePanes ( ) ;
21+
22+ #region Save
23+ //Saving the workbook
24+ workbook . SaveAs ( Path . GetFullPath ( "Output/Output.xlsx" ) ) ;
25+ #endregion
26+ }
27+ }
28+ }
29+ }
30+
31+
32+
33+
34+
You can’t perform that action at this time.
0 commit comments