diff --git a/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries.sln b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries.sln new file mode 100644 index 00000000..be9c7ddf --- /dev/null +++ b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries.sln @@ -0,0 +1,37 @@ + +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}") = "AutoFillUsingFillSeries", "AutoFillUsingFillSeries\AutoFillUsingFillSeries.csproj", "{CD4A72C0-CFFF-4B16-899C-99287DD0AB46}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.Compression.Portable_NET80", "..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj", "{652B9342-F913-C1BF-A30E-31072C9225F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.XlsIO.Portable_NET80", "..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj", "{B1829367-CB57-24F6-0C45-DBCA10D321FF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD4A72C0-CFFF-4B16-899C-99287DD0AB46}.Release|Any CPU.Build.0 = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.Build.0 = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E8F6A654-22D2-4935-986C-BC1CF1D5487F} + EndGlobalSection +EndGlobal diff --git a/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/AutoFillUsingFillSeries.csproj b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/AutoFillUsingFillSeries.csproj new file mode 100644 index 00000000..47ff171f --- /dev/null +++ b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/AutoFillUsingFillSeries.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + diff --git a/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/Output/.gitkeep b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/Program.cs b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/Program.cs new file mode 100644 index 00000000..209bb453 --- /dev/null +++ b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/AutoFillUsingFillSeries/Program.cs @@ -0,0 +1,41 @@ +using Syncfusion.XlsIO; + + +namespace AutoFillUsingFillSeries +{ + class Program + { + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign values to the cells + worksheet["A1"].Number = 2; + worksheet["A2"].Number = 4; + worksheet["A3"].Number = 6; + + //Define the source range + IRange source = worksheet["A1:A3"]; + + //Define the destination range + IRange destinationRange = worksheet["A4:A100"]; + + //Auto fill using the series option + source.AutoFill(destinationRange, ExcelAutoFillType.FillSeries); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); + } + } + } +} + diff --git a/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/README.md b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/README.md new file mode 100644 index 00000000..867477be --- /dev/null +++ b/Worksheet Features/Auto Fill/.NET/AutoFillUsingFillSeries/README.md @@ -0,0 +1,48 @@ +# How to auto fill a series in a worksheet? + +Step 1: Create a new C# Console Application project. + +Step 2: Name the project. + +Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org). + +Step 4: Include the following namespaces in the **Program.cs** file. + +```csharp +using System; +using System.IO; +using Syncfusion.XlsIO; +``` + +Step 5: Include the below code snippet in **Program.cs** to auto fill a series in a worksheet. + +```csharp +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign values to the cells + worksheet["A1"].Number = 2; + worksheet["A2"].Number = 4; + worksheet["A3"].Number = 6; + + //Define the source range + IRange source = worksheet["A1:A3"]; + + //Define the destination range + IRange destinationRange = worksheet["A4:A100"]; + + //Auto fill using the series option + source.AutoFill(destinationRange, ExcelAutoFillType.FillSeries); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); +} +``` \ No newline at end of file diff --git a/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries.sln b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries.sln new file mode 100644 index 00000000..aa944fd0 --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries.sln @@ -0,0 +1,37 @@ + +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}") = "DateTimeFillSeries", "DateTimeFillSeries\DateTimeFillSeries.csproj", "{346AE701-4612-43C5-AD9A-3E2789A1CD32}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.XlsIO.Portable_NET80", "..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj", "{B1829367-CB57-24F6-0C45-DBCA10D321FF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.Compression.Portable_NET80", "..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj", "{652B9342-F913-C1BF-A30E-31072C9225F7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {346AE701-4612-43C5-AD9A-3E2789A1CD32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {346AE701-4612-43C5-AD9A-3E2789A1CD32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {346AE701-4612-43C5-AD9A-3E2789A1CD32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {346AE701-4612-43C5-AD9A-3E2789A1CD32}.Release|Any CPU.Build.0 = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.Build.0 = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {80FA51BF-09BC-42BE-8C5F-1A1D2108B0DE} + EndGlobalSection +EndGlobal diff --git a/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/DateTimeFillSeries.csproj b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/DateTimeFillSeries.csproj new file mode 100644 index 00000000..47ff171f --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/DateTimeFillSeries.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + diff --git a/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/Output/.gitkeep b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/Program.cs b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/Program.cs new file mode 100644 index 00000000..f219bbee --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/DateTimeFillSeries/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.XlsIO; + +namespace DateTimeFillSeries +{ + class Program + { + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign datetime value to the cell + worksheet["A1"].DateTime = new DateTime(2025, 1, 1); + + //Define the range + IRange range = worksheet["A1:A50"]; + + //Fill series using the years option, step value and stop value + range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Years, 2, new DateTime(2100, 1, 1)); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/README.md b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/README.md new file mode 100644 index 00000000..8f077dfa --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/DateTimeFillSeries/README.md @@ -0,0 +1,42 @@ +# How to fill a date series in a worksheet? + +Step 1: Create a new C# Console Application project. + +Step 2: Name the project. + +Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org). + +Step 4: Include the following namespaces in the **Program.cs** file. + +```csharp +using System; +using System.IO; +using Syncfusion.XlsIO; +``` + +Step 5: Include the below code snippet in **Program.cs** to fill a date series in a worksheet. +```csharp +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign datetime value to the cell + worksheet["A1"].DateTime = new DateTime(2025, 1, 1); + + //Define the range + IRange range = worksheet["A1:A50"]; + + //Fill series using the years option + range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Years, 2, new DateTime(2100, 1, 1)); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); +} +``` \ No newline at end of file diff --git a/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend.sln b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend.sln new file mode 100644 index 00000000..98008dca --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend.sln @@ -0,0 +1,37 @@ + +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}") = "FillSeriesByEnablingTrend", "FillSeriesByEnablingTrend\FillSeriesByEnablingTrend.csproj", "{9514937A-D01E-463C-99EE-58739CF69460}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.Compression.Portable_NET80", "..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj", "{652B9342-F913-C1BF-A30E-31072C9225F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.XlsIO.Portable_NET80", "..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj", "{B1829367-CB57-24F6-0C45-DBCA10D321FF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9514937A-D01E-463C-99EE-58739CF69460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9514937A-D01E-463C-99EE-58739CF69460}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9514937A-D01E-463C-99EE-58739CF69460}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9514937A-D01E-463C-99EE-58739CF69460}.Release|Any CPU.Build.0 = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.Build.0 = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3292C768-1ED4-41AF-B4D0-966FE00D1E76} + EndGlobalSection +EndGlobal diff --git a/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend.csproj b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend.csproj new file mode 100644 index 00000000..47ff171f --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + diff --git a/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/Output/.gitkeep b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/Program.cs b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/Program.cs new file mode 100644 index 00000000..c8566d0b --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/FillSeriesByEnablingTrend/Program.cs @@ -0,0 +1,36 @@ +using Syncfusion.XlsIO; + +namespace FillSeriesByEnablingTrend +{ + class Program + { + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign values to the cells + worksheet["A1"].Number = 2; + worksheet["A2"].Number = 4; + worksheet["A3"].Number = 6; + + //Define the range + IRange range = worksheet["A1:A100"]; + + //Fill series using the linear option by enabling trend + range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Linear, true); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/README.md b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/README.md new file mode 100644 index 00000000..80a3d442 --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/FillSeriesByEnablingTrend/README.md @@ -0,0 +1,44 @@ +# How to fill series by enabling trend in a worksheet? + +Step 1: Create a new C# Console Application project. + +Step 2: Name the project. + +Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org). + +Step 4: Include the following namespaces in the **Program.cs** file. + +```csharp +using System; +using System.IO; +using Syncfusion.XlsIO; +``` + +Step 5: Include the below code snippet in **Program.cs** to fill series by enabling trend in a worksheet. +```csharp +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign values to the cells + worksheet["A1"].Number = 2; + worksheet["A2"].Number = 4; + worksheet["A3"].Number = 6; + + //Define the range + IRange range = worksheet["A1:A100"]; + + //Fill series using the linear option by enabling trend + range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Linear, true); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); +} +``` \ No newline at end of file diff --git a/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries.sln b/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries.sln new file mode 100644 index 00000000..52bb8e54 --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries.sln @@ -0,0 +1,37 @@ + +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}") = "NumberFillSeries", "NumberFillSeries\NumberFillSeries.csproj", "{4E2A9524-0186-44CD-80D7-C54D1820DC0F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.Compression.Portable_NET80", "..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj", "{652B9342-F913-C1BF-A30E-31072C9225F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syncfusion.XlsIO.Portable_NET80", "..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj", "{B1829367-CB57-24F6-0C45-DBCA10D321FF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4E2A9524-0186-44CD-80D7-C54D1820DC0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E2A9524-0186-44CD-80D7-C54D1820DC0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E2A9524-0186-44CD-80D7-C54D1820DC0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E2A9524-0186-44CD-80D7-C54D1820DC0F}.Release|Any CPU.Build.0 = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {652B9342-F913-C1BF-A30E-31072C9225F7}.Release|Any CPU.Build.0 = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1829367-CB57-24F6-0C45-DBCA10D321FF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {30715525-6F0C-4F1F-9055-D808F3B7D5F0} + EndGlobalSection +EndGlobal diff --git a/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/NumberFillSeries.csproj b/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/NumberFillSeries.csproj new file mode 100644 index 00000000..47ff171f --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/NumberFillSeries.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + diff --git a/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/Output/.gitkeep b/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/Program.cs b/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/Program.cs new file mode 100644 index 00000000..d920ace0 --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/NumberFillSeries/NumberFillSeries/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.XlsIO; + +namespace NumberFillSeries +{ + class Program + { + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign value to the cell + worksheet["A1"].Number = 1; + + //Define the range + IRange range = worksheet["A1:A100"]; + + //Fill series using the linear option, step value and stop value + range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Linear, 5, 1000); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/Worksheet Features/Fill Series/.NET/NumberFillSeries/README.md b/Worksheet Features/Fill Series/.NET/NumberFillSeries/README.md new file mode 100644 index 00000000..231620f6 --- /dev/null +++ b/Worksheet Features/Fill Series/.NET/NumberFillSeries/README.md @@ -0,0 +1,42 @@ +# How to fill a number series in a worksheet? + +Step 1: Create a new C# Console Application project. + +Step 2: Name the project. + +Step 3: Install the [Syncfusion.XlsIO.Net.Core](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core) NuGet package as reference to your .NET Standard applications from [NuGet.org](https://www.nuget.org). + +Step 4: Include the following namespaces in the **Program.cs** file. + +```csharp +using System; +using System.IO; +using Syncfusion.XlsIO; +``` + +Step 5: Include the below code snippet in **Program.cs** to fill a number series in a worksheet. +```csharp +using (ExcelEngine excelEngine = new ExcelEngine()) +{ + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + IWorkbook workbook = application.Workbooks.Create(1); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Assign value to the cell + worksheet["A1"].Number = 1; + + //Define the range + IRange range = worksheet["A1:A100"]; + + //Fill series using the linear option + range.FillSeries(ExcelSeriesBy.Columns, ExcelFillSeries.Linear, 5, 1000); + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Output.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose streams + outputStream.Dispose(); +} +``` \ No newline at end of file