diff --git a/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks.sln b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks.sln new file mode 100644 index 00000000..8f6571db --- /dev/null +++ b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36127.28 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Row index of page breaks", "Row index of page breaks\Row index of page breaks.csproj", "{DDEB250A-3853-4563-A6D5-FA903F50A782}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DDEB250A-3853-4563-A6D5-FA903F50A782}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DDEB250A-3853-4563-A6D5-FA903F50A782}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DDEB250A-3853-4563-A6D5-FA903F50A782}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DDEB250A-3853-4563-A6D5-FA903F50A782}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7E0AAB3A-C736-4B3F-8AEC-66D28D83803F} + EndGlobalSection +EndGlobal diff --git a/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Data/Input.xlsx b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Data/Input.xlsx new file mode 100644 index 00000000..178c92dc Binary files /dev/null and b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Data/Input.xlsx differ diff --git a/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Output/.gitkeep b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Program.cs b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Program.cs new file mode 100644 index 00000000..955344a3 --- /dev/null +++ b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Program.cs @@ -0,0 +1,26 @@ +using Syncfusion.XlsIO; + +class Program +{ + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.xlsx"), FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorksheet sheet = workbook.Worksheets[0]; + + //Access all horizontal page breaks + for (int i = 0; i < sheet.HPageBreaks.Count; i++) + { + int rowIndex = sheet.HPageBreaks[i].Location.Row; + Console.WriteLine($"Page break {i + 1} is at row: {rowIndex}"); + } + + //Dispose streams + inputStream.Dispose(); + } + } +} \ No newline at end of file diff --git a/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Row index of page breaks.csproj b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Row index of page breaks.csproj new file mode 100644 index 00000000..99a8f5a0 --- /dev/null +++ b/Use Cases/Row index of page breaks/.NET/Row index of page breaks/Row index of page breaks/Row index of page breaks.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + Row_index_of_page_breaks + enable + enable + + + + + + + + + Always + + + Always + + +