File tree Expand file tree Collapse file tree 10 files changed +102
-0
lines changed
Orientation/.NET/Orientation Expand file tree Collapse file tree 10 files changed +102
-0
lines changed Original file line number Diff line number Diff line change 1+ <Solution >
2+ <Project Path =" Orientation/Orientation.csproj" />
3+ </Solution >
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 >net10.0</TargetFramework >
6+ <ImplicitUsings >enable</ImplicitUsings >
7+ <Nullable >enable</Nullable >
8+ </PropertyGroup >
9+
10+ <ItemGroup >
11+ <PackageReference Include =" Syncfusion.XlsIO.Net.Core" Version =" *" />
12+ </ItemGroup >
13+
14+ <ItemGroup >
15+ <None Update =" Output\*" >
16+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
17+ </None >
18+ <None Update =" Data\*" >
19+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
20+ </None >
21+ </ItemGroup >
22+
23+ </Project >
Original file line number Diff line number Diff line change 1+ using System . IO ;
2+ using Syncfusion . XlsIO ;
3+
4+ namespace Orientation
5+ {
6+ class Program
7+ {
8+ static void Main ( string [ ] args )
9+ {
10+ using ( ExcelEngine excelEngine = new ExcelEngine ( ) )
11+ {
12+ IApplication application = excelEngine . Excel ;
13+ application . DefaultVersion = ExcelVersion . Xlsx ;
14+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) ) ;
15+ IWorksheet worksheet = workbook . Worksheets [ 0 ] ;
16+
17+ //Set the page orientation
18+ worksheet . PageSetup . Orientation = ExcelPageOrientation . Landscape ;
19+
20+ //Saving the workbook
21+ workbook . SaveAs ( Path . GetFullPath ( "Output/Output.xlsx" ) ) ;
22+ }
23+ }
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ <Solution >
2+ <Project Path =" PaperSize/PaperSize.csproj" />
3+ </Solution >
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 >net10.0</TargetFramework >
6+ <ImplicitUsings >enable</ImplicitUsings >
7+ <Nullable >enable</Nullable >
8+ </PropertyGroup >
9+
10+ <ItemGroup >
11+ <PackageReference Include =" Syncfusion.XlsIO.Net.Core" Version =" *" />
12+ </ItemGroup >
13+
14+ <ItemGroup >
15+ <None Update =" Output\*" >
16+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
17+ </None >
18+ <None Update =" Data\*" >
19+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
20+ </None >
21+ </ItemGroup >
22+
23+ </Project >
Original file line number Diff line number Diff line change 1+ using System . IO ;
2+ using Syncfusion . XlsIO ;
3+
4+ namespace PaperSize
5+ {
6+ class Program
7+ {
8+ static void Main ( string [ ] args )
9+ {
10+ using ( ExcelEngine excelEngine = new ExcelEngine ( ) )
11+ {
12+ IApplication application = excelEngine . Excel ;
13+ application . DefaultVersion = ExcelVersion . Xlsx ;
14+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) ) ;
15+ IWorksheet worksheet = workbook . Worksheets [ 0 ] ;
16+
17+ //Set the paper size to A4
18+ worksheet . PageSetup . PaperSize = ExcelPaperSize . PaperA4 ;
19+
20+ //Saving the workbook
21+ workbook . SaveAs ( Path . GetFullPath ( "Output/Output.xlsx" ) ) ;
22+ }
23+ }
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments