Skip to content

947645-Need to update the details about Auto fill option in the UG documentation #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj" />
<ProjectReference Include="..\..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
}

Original file line number Diff line number Diff line change
@@ -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();
}
```
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj" />
<ProjectReference Include="..\..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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
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();
}
}
}
}
42 changes: 42 additions & 0 deletions Worksheet Features/Fill Series/.NET/DateTimeFillSeries/README.md
Original file line number Diff line number Diff line change
@@ -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();
}
```
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\compression\Portable\Compression.Portable\Src\Syncfusion.Compression.Portable_NET80.csproj" />
<ProjectReference Include="..\..\..\..\..\..\xlsio\Portable\XlsIO.Portable\Src\Syncfusion.XlsIO.Portable_NET80.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
}
Loading