diff --git a/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation.sln b/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation.sln new file mode 100644 index 00000000..511fa89f --- /dev/null +++ b/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35417.141 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom Validation", "Custom Validation\Custom Validation.csproj", "{9DF53F0C-052E-4760-AF98-06C06305121D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9DF53F0C-052E-4760-AF98-06C06305121D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DF53F0C-052E-4760-AF98-06C06305121D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DF53F0C-052E-4760-AF98-06C06305121D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DF53F0C-052E-4760-AF98-06C06305121D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Custom Validation.csproj b/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Custom Validation.csproj new file mode 100644 index 00000000..b737b2c2 --- /dev/null +++ b/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Custom Validation.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + Custom_Validation + enable + enable + + + + + + + + + Always + + + Always + + + diff --git a/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Output/.gitkeep b/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Program.cs b/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Program.cs new file mode 100644 index 00000000..b7f11294 --- /dev/null +++ b/Data Validation/Custom Validation/.NET/Custom Validation/Custom Validation/Program.cs @@ -0,0 +1,43 @@ +using Syncfusion.XlsIO; + +namespace Custom_Validation +{ + class Program + { + public static void Main(string[] args) + { + // Initialize Excel engine and application. + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + // Create a workbook and worksheet. + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + // Data validation for custom data. + IDataValidation validation = worksheet.Range["A3"].DataValidation; + worksheet.Range["A1"].Text = "Enter the value greater than 10 in A1"; + worksheet.Range["A2"].Text = "Enter the text in A3"; + worksheet.Range["A1"].AutofitColumns(); + validation.AllowType = ExcelDataType.Formula; + validation.FirstFormula = "=A1>10"; + + // Show the error message. + validation.ShowErrorBox = true; + validation.ErrorBoxText = "A1 value is less than 10"; + validation.ErrorBoxTitle = "ERROR"; + validation.PromptBoxText = "Custom Data Validation"; + validation.ShowPromptBox = true; + + // Save the Excel document. + FileStream outputStream = new FileStream(Path.GetFullPath("Output/CustomValidation.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text.sln b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text.sln new file mode 100644 index 00000000..87fc4590 --- /dev/null +++ b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35417.141 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Excel to Text", "Excel to Text\Excel to Text.csproj", "{6657A512-E336-4097-8D5E-BF4A998D261A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6657A512-E336-4097-8D5E-BF4A998D261A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6657A512-E336-4097-8D5E-BF4A998D261A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6657A512-E336-4097-8D5E-BF4A998D261A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6657A512-E336-4097-8D5E-BF4A998D261A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Data/InputTemplate.xlsx b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Data/InputTemplate.xlsx new file mode 100644 index 00000000..2b17c839 Binary files /dev/null and b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Data/InputTemplate.xlsx differ diff --git a/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Excel to Text.csproj b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Excel to Text.csproj new file mode 100644 index 00000000..44ca8c97 --- /dev/null +++ b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Excel to Text.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.0 + Excel_to_Text + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Output/.gitkeep b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Program.cs b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Program.cs new file mode 100644 index 00000000..c7e4303a --- /dev/null +++ b/Excel to Text/Excel to Text/.NET/Excel to Text/Excel to Text/Program.cs @@ -0,0 +1,25 @@ +using Syncfusion.XlsIO; + +namespace Excel_to_Text +{ + class Program + { + public static void Main(string[] args) + { + // Initialize Excel engine and application. + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + // Open an existing workbook. + FileStream inputStream = new FileStream(Path.GetFullPath("Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream); + + // Save the workbook in .txt format with space (" ") as the delimiter. + using FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel to Text.txt"), FileMode.Create, FileAccess.ReadWrite); + workbook.SaveAs(outputStream, " "); + } + } + } +} \ No newline at end of file diff --git a/Import Data to Template/Import Array/.NET/Import Array/Import Array.sln b/Import Data to Template/Import Array/.NET/Import Array/Import Array.sln new file mode 100644 index 00000000..dad37c1f --- /dev/null +++ b/Import Data to Template/Import Array/.NET/Import Array/Import Array.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35417.141 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Import Array", "Import Array\Import Array.csproj", "{686B45E1-3585-408C-B498-8F90C8379DD5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {686B45E1-3585-408C-B498-8F90C8379DD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {686B45E1-3585-408C-B498-8F90C8379DD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {686B45E1-3585-408C-B498-8F90C8379DD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {686B45E1-3585-408C-B498-8F90C8379DD5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Import Data to Template/Import Array/.NET/Import Array/Import Array/Data/InputTemplate.xlsx b/Import Data to Template/Import Array/.NET/Import Array/Import Array/Data/InputTemplate.xlsx new file mode 100644 index 00000000..ca6e8b35 Binary files /dev/null and b/Import Data to Template/Import Array/.NET/Import Array/Import Array/Data/InputTemplate.xlsx differ diff --git a/Import Data to Template/Import Array/.NET/Import Array/Import Array/Import Array.csproj b/Import Data to Template/Import Array/.NET/Import Array/Import Array/Import Array.csproj new file mode 100644 index 00000000..1207bdac --- /dev/null +++ b/Import Data to Template/Import Array/.NET/Import Array/Import Array/Import Array.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + Import_Array + enable + enable + + + + + + + + + Always + + + Always + + + diff --git a/Import Data to Template/Import Array/.NET/Import Array/Import Array/Output/.gitkeep b/Import Data to Template/Import Array/.NET/Import Array/Import Array/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Import Data to Template/Import Array/.NET/Import Array/Import Array/Program.cs b/Import Data to Template/Import Array/.NET/Import Array/Import Array/Program.cs new file mode 100644 index 00000000..952191ee --- /dev/null +++ b/Import Data to Template/Import Array/.NET/Import Array/Import Array/Program.cs @@ -0,0 +1,43 @@ +using Syncfusion.XlsIO; + +namespace Import_Array +{ + class Program + { + public static void Main(string[] args) + { + // Initialize Excel engine and application. + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + // Open an existing workbook. + FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic); + + // Create Template Marker Processor. + ITemplateMarkersProcessor marker = workbook.CreateTemplateMarkersProcessor(); + + // Insert Array Horizontally. + string[] names = { "Mickey", "Donald", "Tom", "Jerry" }; + string[] descriptions = { "Mouse", "Duck", "Cat", "Mouse" }; + + // Add collections to the marker variables where the name should match with input template. + marker.AddVariable("Names", names); + marker.AddVariable("Descriptions", descriptions); + + // Process the markers in the template. + marker.ApplyMarkers(); + + // Saving the workbook. + FileStream outputStream = new FileStream(Path.GetFullPath("Output/ImportArray.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + inputStream.Dispose(); + outputStream.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection.sln b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection.sln new file mode 100644 index 00000000..f1f58886 --- /dev/null +++ b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35417.141 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Import Collection", "Import Collection\Import Collection.csproj", "{8E2BF7A1-1349-4BC9-97C9-137105EE4C35}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8E2BF7A1-1349-4BC9-97C9-137105EE4C35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E2BF7A1-1349-4BC9-97C9-137105EE4C35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E2BF7A1-1349-4BC9-97C9-137105EE4C35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E2BF7A1-1349-4BC9-97C9-137105EE4C35}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Andy.png b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Andy.png new file mode 100644 index 00000000..a9aa8b92 Binary files /dev/null and b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Andy.png differ diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/InputTemplate.xlsx b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/InputTemplate.xlsx new file mode 100644 index 00000000..1c64c102 Binary files /dev/null and b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/InputTemplate.xlsx differ diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Jim.png b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Jim.png new file mode 100644 index 00000000..ef64ae30 Binary files /dev/null and b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Jim.png differ diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Karen.png b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Karen.png new file mode 100644 index 00000000..1cd3aaa6 Binary files /dev/null and b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Karen.png differ diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Phyllis.png b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Phyllis.png new file mode 100644 index 00000000..e6acc84e Binary files /dev/null and b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Phyllis.png differ diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Stanley.png b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Stanley.png new file mode 100644 index 00000000..8358dd05 Binary files /dev/null and b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Data/Stanley.png differ diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Import Collection.csproj b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Import Collection.csproj new file mode 100644 index 00000000..f9c24ca4 --- /dev/null +++ b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Import Collection.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + Import_Collection + enable + enable + + + + + + + + + Always + + + Always + + + diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Output/.gitkeep b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Program.cs b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Program.cs new file mode 100644 index 00000000..e42b852e --- /dev/null +++ b/Import Data to Template/Import Collection/.NET/Import Collection/Import Collection/Program.cs @@ -0,0 +1,70 @@ +using Syncfusion.Licensing; +using Syncfusion.XlsIO; + +namespace Import_Collection +{ + class Program + { + public static void Main(string[] args) + { + // Initialize Excel engine and application. + using ExcelEngine excelEngine = new ExcelEngine(); + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + // Open an existing workbook. + FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream); + + // Create Template Marker Processor. + ITemplateMarkersProcessor marker = workbook.CreateTemplateMarkersProcessor(); + + // Get the data into collection object. + IList reports = GetSalesReports(); + + // Add collections to the marker variables where the name should match with input template. + marker.AddVariable("Reports", reports); + + //Applying Markers + marker.ApplyMarkers(); + + // Saving the workbook. + FileStream outputStream = new FileStream(Path.GetFullPath("Output/ImportCollection.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + inputStream.Dispose(); + outputStream.Dispose(); + } + // Gets a list of sales reports. + private static List GetSalesReports() + { + List reports = new List(); + reports.Add(new Report("Andy Bernard", "45000", "58000", 29, "Data/Andy.png")); + reports.Add(new Report("Jim Halpert", "34000", "65000", 91, "Data/Jim.png")); + reports.Add(new Report("Karen Fillippelli", "75000", "64000", -14, "Data/Karen.png")); + reports.Add(new Report("Phyllis Lapin", "56500", "33600", -40, "Data/Phyllis.png")); + reports.Add(new Report("Stanley Hudson", "46500", "52000", 12, "Data/Stanley.png")); + return reports; + } + + // Sales report. + public class Report + { + public string SalesPerson { get; set; } + public string SalesJanJun { get; set; } + public string SalesJulDec { get; set; } + public int Change { get; set; } + public byte[] Image { get; set; } + + public Report(string name, string janToJun, string julToDec, int change, string imagePath) + { + SalesPerson = name; + SalesJanJun = janToJun; + SalesJulDec = julToDec; + Change = change; + Image = File.ReadAllBytes(imagePath); + } + } + } +} \ No newline at end of file diff --git a/TSV to Excel/TSV to Excel/.NET/TSV to Excel/TSV to Excel/Program.cs b/TSV to Excel/TSV to Excel/.NET/TSV to Excel/TSV to Excel/Program.cs index f0cc19a2..199a7407 100644 --- a/TSV to Excel/TSV to Excel/.NET/TSV to Excel/TSV to Excel/Program.cs +++ b/TSV to Excel/TSV to Excel/.NET/TSV to Excel/TSV to Excel/Program.cs @@ -16,7 +16,7 @@ public static void Main(string[] args) IWorkbook workbook = application.Workbooks.Open(inputStream, "\t"); //Save the workbook - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.ReadWrite); + FileStream outputStream = new FileStream(Path.GetFullPath("Output/TSV to Excel.xlsx"), FileMode.Create, FileAccess.ReadWrite); workbook.SaveAs(outputStream); //Dispose streams diff --git a/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment.sln b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment.sln new file mode 100644 index 00000000..4291a0da --- /dev/null +++ b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35417.141 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Clear Comment", "Clear Comment\Clear Comment.csproj", "{3DD1C5B2-69BA-452E-9B87-358EDD8BC7F4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3DD1C5B2-69BA-452E-9B87-358EDD8BC7F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DD1C5B2-69BA-452E-9B87-358EDD8BC7F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DD1C5B2-69BA-452E-9B87-358EDD8BC7F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DD1C5B2-69BA-452E-9B87-358EDD8BC7F4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Clear Comment.csproj b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Clear Comment.csproj new file mode 100644 index 00000000..c5855c5d --- /dev/null +++ b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Clear Comment.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.0 + Clear_Comment + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Data/CommentsTemplate.xlsx b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Data/CommentsTemplate.xlsx new file mode 100644 index 00000000..bf0fd085 Binary files /dev/null and b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Data/CommentsTemplate.xlsx differ diff --git a/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Output/.gitkeep b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Program.cs b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Program.cs new file mode 100644 index 00000000..c7238f38 --- /dev/null +++ b/Threaded Comments/Clear Comment/.NET/Clear Comment/Clear Comment/Program.cs @@ -0,0 +1,33 @@ +using Syncfusion.XlsIO; + +namespace Clear_Comment +{ + 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/CommentsTemplate.xlsx"), FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Get the collection of threaded comments in the worksheet + IThreadedComments threadedComments = worksheet.ThreadedComments; + + //Clear all the threaded comments + threadedComments.Clear(); + + //Saving the workbook as stream + FileStream outputStream = new FileStream(Path.GetFullPath("Output/ClearComment.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + inputStream.Dispose(); + outputStream.Dispose(); + } + } + } +} diff --git a/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment.sln b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment.sln new file mode 100644 index 00000000..b7e89984 --- /dev/null +++ b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35417.141 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Delete Comment", "Delete Comment\Delete Comment.csproj", "{143EE01E-50AC-4650-B610-80A008B94993}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {143EE01E-50AC-4650-B610-80A008B94993}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {143EE01E-50AC-4650-B610-80A008B94993}.Debug|Any CPU.Build.0 = Debug|Any CPU + {143EE01E-50AC-4650-B610-80A008B94993}.Release|Any CPU.ActiveCfg = Release|Any CPU + {143EE01E-50AC-4650-B610-80A008B94993}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Data/CommentsTemplate.xlsx b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Data/CommentsTemplate.xlsx new file mode 100644 index 00000000..bf0fd085 Binary files /dev/null and b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Data/CommentsTemplate.xlsx differ diff --git a/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Delete Comment.csproj b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Delete Comment.csproj new file mode 100644 index 00000000..f7896643 --- /dev/null +++ b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Delete Comment.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + Delete_Comment + enable + enable + + + + + + + + + Always + + + Always + + + diff --git a/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Output/.gitkeep b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Program.cs b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Program.cs new file mode 100644 index 00000000..16cb130c --- /dev/null +++ b/Threaded Comments/Delete Comment/.NET/Delete Comment/Delete Comment/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.Licensing; +using Syncfusion.XlsIO; + +namespace Delete_Comment +{ + 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/CommentsTemplate.xlsx"), FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Get the collection of threaded comments in the worksheet + IThreadedComments threadedComments = worksheet.ThreadedComments; + + //Delete the threaded comment + threadedComments[0].Delete(); + + //Saving the workbook as stream + FileStream outputStream = new FileStream(Path.GetFullPath("Output/DeleteComment.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + inputStream.Dispose(); + outputStream.Dispose(); + } + } + } +} \ No newline at end of file