From cd20e8e94342397163767948f7f13dd4500a9647 Mon Sep 17 00:00:00 2001 From: KarthikaSF4773 Date: Thu, 6 Nov 2025 11:38:33 +0530 Subject: [PATCH 1/2] 990137-ExcelToHtmlUG --- .../Excel-to-HTML/NET/Excel-to-HTML-Conversion.md | 8 ++------ .../Excel/Conversions/Excel-to-HTML/overview.md | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Document-Processing/Excel/Conversions/Excel-to-HTML/NET/Excel-to-HTML-Conversion.md b/Document-Processing/Excel/Conversions/Excel-to-HTML/NET/Excel-to-HTML-Conversion.md index 9dc9d13c4..4d65e08c3 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-HTML/NET/Excel-to-HTML-Conversion.md +++ b/Document-Processing/Excel/Conversions/Excel-to-HTML/NET/Excel-to-HTML-Conversion.md @@ -35,7 +35,7 @@ using (ExcelEngine excelEngine = new ExcelEngine()) worksheet.SaveAsHtml(stream); //Save a workbook as HTML file - workbook.SaveAsHtml(stream, Syncfusion.XlsIO.Implementation.HtmlSaveOptions.Default); + workbook.SaveAsHtml("Sample.html", Syncfusion.XlsIO.Implementation.HtmlSaveOptions.Default); stream.Dispose(); workbook.Close(); } @@ -97,12 +97,8 @@ using (ExcelEngine excelEngine = new ExcelEngine()) #region Save as HTML //Saving the workbook - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.html"), FileMode.Create, FileAccess.Write); - workbook.SaveAsHtml(outputStream, saveOptions); + workbook.SaveAsHtml(Path.GetFullPath("Output/Output.html"), saveOptions); #endregion - - //Dispose streams - outputStream.Dispose(); } {% endhighlight %} diff --git a/Document-Processing/Excel/Conversions/Excel-to-HTML/overview.md b/Document-Processing/Excel/Conversions/Excel-to-HTML/overview.md index 9dc9d13c4..4d65e08c3 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-HTML/overview.md +++ b/Document-Processing/Excel/Conversions/Excel-to-HTML/overview.md @@ -35,7 +35,7 @@ using (ExcelEngine excelEngine = new ExcelEngine()) worksheet.SaveAsHtml(stream); //Save a workbook as HTML file - workbook.SaveAsHtml(stream, Syncfusion.XlsIO.Implementation.HtmlSaveOptions.Default); + workbook.SaveAsHtml("Sample.html", Syncfusion.XlsIO.Implementation.HtmlSaveOptions.Default); stream.Dispose(); workbook.Close(); } @@ -97,12 +97,8 @@ using (ExcelEngine excelEngine = new ExcelEngine()) #region Save as HTML //Saving the workbook - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.html"), FileMode.Create, FileAccess.Write); - workbook.SaveAsHtml(outputStream, saveOptions); + workbook.SaveAsHtml(Path.GetFullPath("Output/Output.html"), saveOptions); #endregion - - //Dispose streams - outputStream.Dispose(); } {% endhighlight %} From 874bf5f5fa9fd018971007ea4f4527c635e9ba26 Mon Sep 17 00:00:00 2001 From: KarthikaSF4773 Date: Thu, 6 Nov 2025 13:39:28 +0530 Subject: [PATCH 2/2] 990137-ExcelToHtmlUG --- .../NET/Excel-to-JSON-Conversion.md | 90 +++++-------------- .../Conversions/Excel-to-JSON/overview.md | 90 +++++-------------- .../NET/Excel-to-ODS-Conversion.md | 6 +- .../Conversions/Excel-to-ODS/overview.md | 6 +- 4 files changed, 50 insertions(+), 142 deletions(-) diff --git a/Document-Processing/Excel/Conversions/Excel-to-JSON/NET/Excel-to-JSON-Conversion.md b/Document-Processing/Excel/Conversions/Excel-to-JSON/NET/Excel-to-JSON-Conversion.md index 45f6be657..ab9240fef 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-JSON/NET/Excel-to-JSON-Conversion.md +++ b/Document-Processing/Excel/Conversions/Excel-to-JSON/NET/Excel-to-JSON-Conversion.md @@ -29,25 +29,17 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Workbook-To-JSON-as-schema-default.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Workbook-To-JSON-as-schema-default.json")); - //Saves the workbook to a JSON filestream as schema - FileStream stream1 = new FileStream(Path.GetFullPath("Output/Excel-Workbook-To-JSON-as-schema.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(stream1, true); + //Saves the workbook to JSON as schema + workbook.SaveAsJson("Output/Excel-Workbook-To-JSON-as-schema.json", true); #endregion - //Dispose streams - outputStream.Dispose(); - stream1.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON @@ -181,20 +173,14 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON file without schema - FileStream outputStream = new FileStream("Output/Workbook-To-JSON-without-schema.json", FileMode.Create); - workbook.SaveAsJson(outputStream,false); + //Saves the workbook to JSON file without schema + workbook.SaveAsJson(Path.GetFullPath(@"Output/Workbook-To-JSON-without-schema.json"),false); #endregion - //Dispose streams - outputStream.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON #endregion @@ -311,25 +297,17 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream("Output/Excel-Worksheet-To-JSON-filestream-as-schema-default.json", FileMode.Create); - workbook.SaveAsJson(outputStream, worksheet); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath(@"Output/Excel-Worksheet-To-JSON-filestream-as-schema-default.json"), worksheet); - //Saves the workbook to a JSON filestream as schema - FileStream stream1 = new FileStream("Output/Excel-Worksheet-To-JSON-filestream-as-schema.json", FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(stream1, worksheet, true); + //Saves the workbook to JSON as schema + workbook.SaveAsJson(Path.GetFullPath(@"Output/Excel-Worksheet-To-JSON-filestream-as-schema.json"), worksheet, true); #endregion - //Dispose streams - outputStream.Dispose(); - stream1.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON @@ -466,20 +444,14 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Worksheet-To-JSON-filestream-without-schema.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream, worksheet,false); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Worksheet-To-JSON-filestream-without-schema.json"), worksheet,false); #endregion - //Dispose streams - outputStream.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON #endregion @@ -602,28 +574,20 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; //Custom range IRange range = worksheet.Range["A1:F100"]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Range-To-JSON-as-schema-default.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream, range); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Range-To-JSON-as-schema-default.json"), range); - //Saves the workbook to a JSON filestream as schema - FileStream stream1 = new FileStream("Output/Excel-Range-To-JSON-as-schema.json", FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(stream1, range, true); + //Saves the workbook to JSON as schema + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Range-To-JSON-as-schema.json"), range, true); #endregion - //Dispose streams - outputStream.Dispose(); - stream1.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON @@ -769,23 +733,17 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; //Custom range IRange range = worksheet.Range["A1:F100"]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Range-To-JSON-filestream-without-schema.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream, range, false); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Range-To-JSON-filestream-without-schema.json"), range, false); #endregion - //Dispose streams - outputStream.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON #endregion diff --git a/Document-Processing/Excel/Conversions/Excel-to-JSON/overview.md b/Document-Processing/Excel/Conversions/Excel-to-JSON/overview.md index 943056319..11c1d9c03 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-JSON/overview.md +++ b/Document-Processing/Excel/Conversions/Excel-to-JSON/overview.md @@ -29,25 +29,17 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Workbook-To-JSON-as-schema-default.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Workbook-To-JSON-as-schema-default.json")); - //Saves the workbook to a JSON filestream as schema - FileStream stream1 = new FileStream("Output/Excel-Workbook-To-JSON-as-schema.json", FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(stream1, true); + //Saves the workbook to JSON as schema + workbook.SaveAsJson("Output/Excel-Workbook-To-JSON-as-schema.json", true); #endregion - //Dispose streams - outputStream.Dispose(); - stream1.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON @@ -181,20 +173,14 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON file without schema - FileStream outputStream = new FileStream("Output/Workbook-To-JSON-without-schema.json", FileMode.Create); - workbook.SaveAsJson(outputStream,false); + //Saves the workbook to JSON file without schema + workbook.SaveAsJson(Path.GetFullPath(@"Output/Workbook-To-JSON-without-schema.json"),false); #endregion - //Dispose streams - outputStream.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON #endregion @@ -311,25 +297,17 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream("Output/Excel-Worksheet-To-JSON-filestream-as-schema-default.json", FileMode.Create); - workbook.SaveAsJson(outputStream, worksheet); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath(@"Output/Excel-Worksheet-To-JSON-filestream-as-schema-default.json"), worksheet); - //Saves the workbook to a JSON filestream as schema - FileStream stream1 = new FileStream("Output/Excel-Worksheet-To-JSON-filestream-as-schema.json", FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(stream1, worksheet, true); + //Saves the workbook to JSON as schema + workbook.SaveAsJson(Path.GetFullPath(@"Output/Excel-Worksheet-To-JSON-filestream-as-schema.json"), worksheet, true); #endregion - //Dispose streams - outputStream.Dispose(); - stream1.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON @@ -466,20 +444,14 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Worksheet-To-JSON-filestream-without-schema.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream, worksheet,false); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Worksheet-To-JSON-filestream-without-schema.json"), worksheet,false); #endregion - //Dispose streams - outputStream.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON #endregion @@ -602,28 +574,20 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; //Custom range IRange range = worksheet.Range["A1:F100"]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Range-To-JSON-as-schema-default.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream, range); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Range-To-JSON-as-schema-default.json"), range); - //Saves the workbook to a JSON filestream as schema - FileStream stream1 = new FileStream("Output/Excel-Range-To-JSON-as-schema.json", FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(stream1, range, true); + //Saves the workbook to JSON as schema + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Range-To-JSON-as-schema.json"), range, true); #endregion - //Dispose streams - outputStream.Dispose(); - stream1.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON @@ -769,23 +733,17 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx")); IWorksheet worksheet = workbook.Worksheets[0]; //Custom range IRange range = worksheet.Range["A1:F100"]; #region save as JSON - //Saves the workbook to a JSON filestream, as schema by default - FileStream outputStream = new FileStream(Path.GetFullPath("Output/Excel-Range-To-JSON-filestream-without-schema.json"), FileMode.Create, FileAccess.ReadWrite); - workbook.SaveAsJson(outputStream, range, false); + //Saves the workbook to JSON, as schema by default + workbook.SaveAsJson(Path.GetFullPath("Output/Excel-Range-To-JSON-filestream-without-schema.json"), range, false); #endregion - //Dispose streams - outputStream.Dispose(); - inputStream.Dispose(); - #region Open JSON //Open default JSON #endregion diff --git a/Document-Processing/Excel/Conversions/Excel-to-ODS/NET/Excel-to-ODS-Conversion.md b/Document-Processing/Excel/Conversions/Excel-to-ODS/NET/Excel-to-ODS-Conversion.md index 368b1cb96..c59d1d82f 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-ODS/NET/Excel-to-ODS-Conversion.md +++ b/Document-Processing/Excel/Conversions/Excel-to-ODS/NET/Excel-to-ODS-Conversion.md @@ -59,12 +59,8 @@ using (ExcelEngine excelEngine = new ExcelEngine()) #region Save //Saving the workbook - FileStream outputStream = new FileStream(Path.GetFullPath("Output/ExcelToODS.ods"), FileMode.Create, FileAccess.Write); - workbook.SaveAs(outputStream, ExcelSaveType.SaveAsODS); + workbook.SaveAs("Output.ods"); #endregion - - //Dispose streams - outputStream.Dispose(); } {% endhighlight %} diff --git a/Document-Processing/Excel/Conversions/Excel-to-ODS/overview.md b/Document-Processing/Excel/Conversions/Excel-to-ODS/overview.md index 368b1cb96..c59d1d82f 100644 --- a/Document-Processing/Excel/Conversions/Excel-to-ODS/overview.md +++ b/Document-Processing/Excel/Conversions/Excel-to-ODS/overview.md @@ -59,12 +59,8 @@ using (ExcelEngine excelEngine = new ExcelEngine()) #region Save //Saving the workbook - FileStream outputStream = new FileStream(Path.GetFullPath("Output/ExcelToODS.ods"), FileMode.Create, FileAccess.Write); - workbook.SaveAs(outputStream, ExcelSaveType.SaveAsODS); + workbook.SaveAs("Output.ods"); #endregion - - //Dispose streams - outputStream.Dispose(); } {% endhighlight %}