diff --git a/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels.sln b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels.sln new file mode 100644 index 00000000..d351b2ff --- /dev/null +++ b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34310.174 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Get Row Height and Column Width in Pixels", "Get Row Height and Column Width in Pixels\Get Row Height and Column Width in Pixels.csproj", "{2E122617-D2C7-4102-AF81-CEDA4F7F77BC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E122617-D2C7-4102-AF81-CEDA4F7F77BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E122617-D2C7-4102-AF81-CEDA4F7F77BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E122617-D2C7-4102-AF81-CEDA4F7F77BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E122617-D2C7-4102-AF81-CEDA4F7F77BC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6121E09A-8AC5-4FBC-99AB-85C44D57F5A6} + EndGlobalSection +EndGlobal diff --git a/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Data/InputTemplate.xlsx b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Data/InputTemplate.xlsx new file mode 100644 index 00000000..d7db3592 Binary files /dev/null and b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Data/InputTemplate.xlsx differ diff --git a/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels.csproj b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels.csproj new file mode 100644 index 00000000..e509bbec --- /dev/null +++ b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Get_Row_Height_and_Column_Width_in_Pixels + enable + enable + + + + + + + diff --git a/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Program.cs b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Program.cs new file mode 100644 index 00000000..f058e457 --- /dev/null +++ b/Format rows and columns/Get Row Height and Column Width in Pixels/NET Standard/Get Row Height and Column Width in Pixels/Get Row Height and Column Width in Pixels/Program.cs @@ -0,0 +1,32 @@ +using Syncfusion.XlsIO; +namespace Get_Row_Height_and_Column_Width_in_Pixels +{ + class Program +{ + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Load an existing file + FileStream inputStream = new FileStream("../../../Data/InputTemplate.xlsx", FileMode.Open); + IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Get row height in pixels + int rowheight = worksheet.GetRowHeightInPixels(1); + + //Get column width in pixels + int columnwidth = worksheet.GetColumnWidthInPixels(1); + + Console.WriteLine($"Row Height: {rowheight}"); + Console.WriteLine($"Column Width: {columnwidth}"); + + //Dispose stream + inputStream.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels.sln b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels.sln new file mode 100644 index 00000000..91de5f31 --- /dev/null +++ b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34310.174 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set Row Height and Column Width in Pixels", "Set Row Height and Column Width in Pixels\Set Row Height and Column Width in Pixels.csproj", "{6B56B9B2-0F14-4C38-9ACE-AB023040D00A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6B56B9B2-0F14-4C38-9ACE-AB023040D00A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B56B9B2-0F14-4C38-9ACE-AB023040D00A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B56B9B2-0F14-4C38-9ACE-AB023040D00A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B56B9B2-0F14-4C38-9ACE-AB023040D00A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5CC7961F-D80D-4D04-8877-C28AF652E914} + EndGlobalSection +EndGlobal diff --git a/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Data/InputTemplate.xlsx b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Data/InputTemplate.xlsx new file mode 100644 index 00000000..30ea02ab Binary files /dev/null and b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Data/InputTemplate.xlsx differ diff --git a/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Data/~$InputTemplate.xlsx b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Data/~$InputTemplate.xlsx new file mode 100644 index 00000000..ebc3a084 Binary files /dev/null and b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Data/~$InputTemplate.xlsx differ diff --git a/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Program.cs b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Program.cs new file mode 100644 index 00000000..3fc4869f --- /dev/null +++ b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.XlsIO; +namespace Set_Row_Height_and_Column_width_in_pixels +{ + class Program + { + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Load an existing file + FileStream inputStream = new FileStream("../../../Data/InputTemplate.xlsx", FileMode.Open); + IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Set row height in pixels + worksheet.SetRowHeightInPixels(2, 50); + + //Get column width in pixels + worksheet.SetColumnWidthInPixels(3, 100); + + //Save the workbook as stream + FileStream outputStream = new FileStream("Output.xlsx", FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose stream + inputStream.Dispose(); + outputStream.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels.csproj b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels.csproj new file mode 100644 index 00000000..b1cfc0a8 --- /dev/null +++ b/Format rows and columns/Set Row Height and Column Width in Pixels/NET Standard/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels/Set Row Height and Column Width in Pixels.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Set_Row_Height_and_Column_Width_in_Pixels + enable + enable + + + + + + +